Potential Payment MFE with Olive?

Please bear in mind that I have yet to figure out what might be the problem.

I upgraded Tutor from Nutmeg to Olive and ran tutor local launch

ecommerce still seems to work, but suddenly my configuration for Cybersource in config.yml no longer works with Olive. As a result, the Payment MFE no longer loads.

Has anybody encountered that problem with Olive?

1 Like

First of all: did you re-build the mfe image with tutor images build mfe? To clarify, you need to do the following:

tutor plugins enable ecommerce
tutor config save
tutor images build mfe
tutor local launch

Full disclosure: I didn’t test the payment/orders MFEs with the new dynamic configuration yet, so I don’t know whether they work or not.

I will try again.

ecommerce is definitely working as I am accessing the ecommerce console.

I will retry building the mfe image and do a local launch again. It failed


As we will deploy our Tutor Nutmeg Production Server later this January, therefore what I am testing right now is definitely not an emergency, so we have time to look into it. Since I had a test server with Nutmeg, I wanted to try Olive on it right away just in case we face some issues. Everything looks good at first glance except for the Payment MFE.

As I will be on vacation and holidays starting at the end of the day and up until January 5th when I come back to work, I may not be able to find the cause of the problem before then.

The web browser console of the docker logs are not giving a lot of information about what could be the problem thus far. Maybe I am just not seeing it. All I get is the cryptic message telling me there was an error and if it persists I should contact the edX support :roll_eyes:

In order to make sure the problem is not related to Cybersource or specific to it, I will attempt to use only PayPal as a payment processor. Luckily, even if we do not use PayPal, I do have a Merchant Account that I used to check the Payment MFE before. If even PayPal does not allow the Payment MFE to display, we might have a bigger problem than anticipated.

Still unable to display the Payment MFE.

Here’s what I get when I try to upgrade a course and what displays in the Firefox Developer Console. There’s not much more useful information in the docker container logs for ecommerce or even for

Any suggestions at what I should look at? Thanks for any advice.

I’m reasonably sure that without porting away from the old mfe-env-* patches, which I’m pretty sure tutor-ecommerce uses, the Payment MFE won’t work. That is certainly one explanation for the console and UI errors.

I would agree, but the current tutor-ecommerce only uses the following patches:

ecommerce-settings-common
ecommerce-settings-development
ecommerce-settings-production

And the only clear reference to the frontend-app-payment is a call in tutorecommerce/plugin.py that might need to be modified or not to make compliant with the other MFEs.

I am also concerned that all the changes made to support Stripe by 2U may have broken ecommerce and/or the frontend-app-payment for Open edX. Unfortunately, I have no way to support that hypothesis.

What I would need is a second opinion by someone who used Cybersource in Nutmeg and that could test Cybersource with Olive. Or someone who could setup Cybersource in a fresh installation of Olive.

I see an mfe-env-production. And these lines in plugin.py won’t work, either. So yeah, the payment MFE can’t work as it is now.

(I would write a PR myself, but a) I don’t have time at the moment, and b) I don’t know how to test ecommerce!)

Thanks for your findings @arbrandes

I could be wrong, but I believe the mfe-env-production file is a leftover from previous releases and is not being used by Olive.

I’ve also compared calls between my working version under Nutmeg and my non-working version under Olive.

Under Nutmeg and working

https://ecommerce.test-cours.edulib.org/bff/payment/v0/capture-context
https://ecommerce.test-cours.edulib.org/bff/payment/v0/payment/

Under Olive and not working

https://apps.cours-virginie.edulib.org/null/bff/payment/v0/capture-context
https://apps.cours-virginie.edulib.org/null/bff/payment/v0/payment/

One environment is calling ecommerce and the other is calling an MFE.
Could this be related to the lines that are wrong under plugin.py ? I am guessing it is


Actually, I think it’s because of mfe-env-production. In particular, the first line. That variable will be empty, and would therefore result in the weird URL you’re seeing in Olive.

@sambapete can you try to rerun while adding the following create/adding the following patch

from tutor import hooks

hooks.Filters.ENV_PATCHES.add_item(
    (
        "openedx-lms-production-settings",
        """
MFE_CONFIG["ECOMMERCE_BASE_URL"] = "<your url to your ecommerce service>"
"""
    ),
)

The above patch should mitigate @arbrandes point above, until the plugin is updated.

Another point is can you ensure from the network traffic in browser there is a call to mfe_config there should be a call to it and it after adding the above patch it should return ECOMMERCE_BASE_URL. Just note that the API uses browser cache so you migh not see the change instantly

2 Likes

Sorry @ghassan I hadn’t seen your reply this morning. I will definitely try it. I will let you know if it works. Thanks.

@ghassan The patch works perfectly. Thank you.

I was able to access the Payment MFE and do a transaction.

1 Like

Thanks @sambapete for raising this issue and @ghassan for providing a fix. I released v15.0.2: fix: integrate with MFE dynamic configuration by regisb · Pull Request #36 · overhangio/tutor-ecommerce · GitHub Please report any further issue here.

3 Likes

A post was split to a new topic: Payment MFE returns 404