Ecommerce: Changes to Stripe payment processor

Hi everybody!

We just wrapped up a project that upgrades the existing Stripe payment processor in ecommerce to support Stripe payment intents and makes it compatible with frontend-app-payment.

The code is already in master, and is eligible for inclusion in an Open edX named release starting in Palm (June 9, 2023) or later.

Audience

Who Why
Operators who use the existing Ecommerce Stripe Charges-based payment processor Inform of a breaking change
Operators who would like to migrate from Cybersource to Stripe Inform this feature has been implemented
Operators who are running the Cybersource payment processor Inform of significant change to codebase that may require testing prior to deployment
All of the above Solicit assistance with pre-Palm testing of the new feature

What is not changing

  • Cybersource remains the default payment processor for ecommerce and frontend-app-payment. Instances running Cybersource should see no changes.

  • Ecommerce is still officially deprecated and we continue to work on the Ecommerce Replacement Project.

What is changing

  • The legacy Stripe Charges ecommerce payment processor with a frontend in ecommerce is upgraded to a Stripe Payment Intents payment processor with a frontend in frontend-app-payment.

What next?

  • If you use Stripe Charges, we’d appreciate your feedback on the documentation and any volunteers to be an early tester of transitioning from Stripe Charges to Stripe Payment Intents.

    • As we never ran Stripe Charges ourselves, we were unable to test these changes in our deployment. This is why we need your help.

    • Given the speed we were obliged to move on this project, we’d be happy to help support community transitions from Stripe Charges to Stripe Payment Intents to make sure our changes don’t break other people’s deployments.

    • Please reach out in the #ecommerce channel of Open edX Slack if this applies to you.

  • If you use Ecommerce, please consider planning and testing your upgrade to Palm earlier than usual due to this major change in payment processors in Ecommerce.

More information

How to reach us

#ecommerce channel of Open edX Slack

Much obliged,
Purchase Squad, 2U/edx.org

4 Likes

Hello!

I tested Stripe for Payment MFE, but I couldn’t perform a test payment. The payment form from the Stripe service appears, but there’s an issue with the secret key. I receive an error message: “This API call cannot be made with a publishable API key. Please use a secret API key. You can find a list of your API keys at [link to Stripe dashboard].”

I used both the secret and public keys from my test Stripe account. I suspect the problem may be related to using test keys. However, I’m puzzled as to why the payment form from the Stripe service appears if it also uses a key, albeit a public one.

I would appreciate any assistance in resolving this issue, as it’s a significant change in payment processors in Ecommerce.

If you have the opportunity to help or have any ideas, please let me know.

Thank you!

Hi @Dmytro_Alipov, thanks for reaching out!

Could you provide more context regarding this error?

  • Is the call to Stripe generating the error called from Ecommerce or from Payment MFE?

  • What line of code is generating this error?

  • Are your Ecommerce Stripe settings from these docs appropriately set?

  • When running ./manage.py diffsettings to see your effective configuration, is PAYMENT_PROCESSOR_CONFIG["edx"]["stripe"]["secret_key"] what you expect?

In our testing, Stripe:

  • Expects a publishable key (pk_...) from Payment MFE.

  • Expects a secret key (sk_...) from Ecommerce.

  • Worked the same way with a test key (..._test_...) as a live key (..._live_...)

(For others following along who may be new to this, please see Stripe’s API key docs for a primer.)

Thanks,
Phil

Hi @Dmytro_Alipov, did the above work?

Thanks,
Phil

Hi, Phil! Sorry for the long answer. I have not yet continued to deal with this issue. In the near future, we will continue and I will describe in more detail the nuances I encountered.

No problem! Thanks for the update!

Hi @pshiu! Could you please update me on the current status of the Client-side payment page? Am I correct in understanding that it’s currently not possible to use it, as the backend has been redesigned to work with Payment MFE, specifically using payment_intent_id instead of stripe_token.

Client-side payment page:

Hello @pshiu @Dmytro_Alipov

I am trying to set up stripe as payment processor for openedx ecommerce. I am also seeing the same error as image above after entering stripe test card details. It seems that here token is generated but intent_id is expected so the error is being thrown.

When I disable “disable_microfrontend_for_basket_page” flag in ecommerce from admin panel, then the intent_id is generated as I noticed from stripe dashboard.

So, is there any update or solution on how can we make stripe payment processor working?

Help is much appreciated. Thanks.

Hi @Yogesh!

As I understand it, currently the Stripe payment processor can only be configured for Payment MFE. Therefore, it is necessary that the flag disable_microfrontend_for_basket_page be disabled.

I also found out that you need to contact Stripe support so that they enable some permissions for your account (I haven’t figured out which ones yet). I found this here.

If you have any news regarding creating a Stripe account in the future, I would appreciate it if you would share it here.

Hi @Dmytro_Alipov ,

I am trying to implement the stripe processor with the payment MFE however i was running into an issue with the “secret_key_confirmation”, I removed this from the ecommerce code on the docker container and that got me past that error. However I am getting a new error with the stripe api call for the billing details where it sends no key.
image

Would appreciate any help regarding this.

Hi @MMarei

You did the right thing by removing this parameter since I didn’t find it in the documentation either.

I don’t have an answer to the question of why the existing API key doesn’t work (the same thing happens to me). My understanding is that you need to request some permissions for your account from Stripe support. I haven’t done this yet.

If you do so that the API key will work, please write what you did for this. :slightly_smiling_face:

I am new to open edx and seem lost with this process. I tried rolling back to the charges API but that gave me an error with the course entitlement being made but never shown to the user at checkout (Instead, an error appears).

If anyone has any ideas on how to create course entitlements properly for charges on Palm (forked repo) or comes up with new solutions for this please let me know. @Dmytro_Alipov @pshiu