# Potential Payment MFE with Olive?

**URL:** <https://discuss.openedx.org/t/potential-payment-mfe-with-olive/8948>\
**Category:** Site Operators\
**Tags:** tutor\
**Created:** [December 15, 2022, 4:30pm UTC](https://discuss.openedx.org/t/potential-payment-mfe-with-olive/8948 "2022-12-15T16:30:51Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![sambapete](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/sambapete/32/4100_2.png) [@sambapete](https://discuss.openedx.org/u/sambapete)\
**Post date:** [December 15, 2022, 4:30pm UTC](https://discuss.openedx.org/t/potential-payment-mfe-with-olive/8948/1 "2022-12-15T16:30:51Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![regis](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/regis/32/2640_2.png) [@regis](https://discuss.openedx.org/u/regis)\
**Post date:** [December 15, 2022, 4:34pm UTC](https://discuss.openedx.org/t/potential-payment-mfe-with-olive/8948/2 "2022-12-15T16:34:58Z")

</div>

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

```auto
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.

---

<div class="post-metadata">

**Author:** ![sambapete](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/sambapete/32/4100_2.png) [@sambapete](https://discuss.openedx.org/u/sambapete)\
**Post date:** [December 15, 2022, 5:04pm UTC](https://discuss.openedx.org/t/potential-payment-mfe-with-olive/8948/3 "2022-12-15T17:04:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sambapete](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/sambapete/32/4100_2.png) [@sambapete](https://discuss.openedx.org/u/sambapete)\
**Post date:** [December 16, 2022, 12:36pm UTC](https://discuss.openedx.org/t/potential-payment-mfe-with-olive/8948/4 "2022-12-16T12:36:13Z")

</div>

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 🙄

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.

---

<div class="post-metadata">

**Author:** ![sambapete](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/sambapete/32/4100_2.png) [@sambapete](https://discuss.openedx.org/u/sambapete)\
**Post date:** [December 16, 2022, 3:12pm UTC](https://discuss.openedx.org/t/potential-payment-mfe-with-olive/8948/5 "2022-12-16T15:12:27Z")

</div>

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.

 ![Capture d’écran, le 2022-12-16 à 10.16.46](https://us1.discourse-cdn.com/flex020/uploads/openedx/original/2X/8/8177164b58e649cf88f203e3663722bcc39d05c3.png)

 ![Capture d’écran, le 2022-12-16 à 10.12.08](https://us1.discourse-cdn.com/flex020/uploads/openedx/original/2X/e/efdb7d1dfaf09508878532783f5f4a78abcbd896.jpeg)

---

<div class="post-metadata">

**Author:** ![arbrandes](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/arbrandes/32/158_2.png) [@arbrandes](https://discuss.openedx.org/u/arbrandes)\
**Post date:** [December 16, 2022, 5:49pm UTC](https://discuss.openedx.org/t/potential-payment-mfe-with-olive/8948/6 "2022-12-16T17:49:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sambapete](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/sambapete/32/4100_2.png) [@sambapete](https://discuss.openedx.org/u/sambapete)\
**Post date:** [December 16, 2022, 8:06pm UTC](https://discuss.openedx.org/t/potential-payment-mfe-with-olive/8948/7 "2022-12-16T20:06:06Z")

</div>

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

```auto
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.

---

<div class="post-metadata">

**Author:** ![sambapete](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/sambapete/32/4100_2.png) [@sambapete](https://discuss.openedx.org/u/sambapete)\
**Post date:** [December 16, 2022, 8:12pm UTC](https://discuss.openedx.org/t/potential-payment-mfe-with-olive/8948/8 "2022-12-16T20:12:17Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![arbrandes](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/arbrandes/32/158_2.png) [@arbrandes](https://discuss.openedx.org/u/arbrandes)\
**Post date:** [December 16, 2022, 8:26pm UTC](https://discuss.openedx.org/t/potential-payment-mfe-with-olive/8948/9 "2022-12-16T20:26:50Z")

</div>

I see an [`mfe-env-production`](https://github.com/overhangio/tutor-ecommerce/blob/master/tutorecommerce/patches/mfe-env-production). And [these lines in plugin.py](https://github.com/overhangio/tutor-ecommerce/blob/master/tutorecommerce/plugin.py#L65-L76) won’t work, either. So yeah, the payment MFE can’t work as it is now.

---

<div class="post-metadata">

**Author:** ![arbrandes](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/arbrandes/32/158_2.png) [@arbrandes](https://discuss.openedx.org/u/arbrandes)\
**Post date:** [December 16, 2022, 8:27pm UTC](https://discuss.openedx.org/t/potential-payment-mfe-with-olive/8948/10 "2022-12-16T20:27:56Z")

</div>

(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!)

---

<div class="post-metadata">

**Author:** ![sambapete](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/sambapete/32/4100_2.png) [@sambapete](https://discuss.openedx.org/u/sambapete)\
**Post date:** [December 16, 2022, 9:02pm UTC](https://discuss.openedx.org/t/potential-payment-mfe-with-olive/8948/11 "2022-12-16T21:02:39Z")

</div>

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

```auto
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

```auto
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…

---

<div class="post-metadata">

**Author:** ![arbrandes](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/arbrandes/32/158_2.png) [@arbrandes](https://discuss.openedx.org/u/arbrandes)\
**Post date:** [December 19, 2022, 10:13am UTC](https://discuss.openedx.org/t/potential-payment-mfe-with-olive/8948/12 "2022-12-19T10:13:44Z")

</div>

> [@sambapete](#):
>
> Could this be related to the lines that are wrong under plugin.py ?

Actually, I think it’s because of `mfe-env-production`. In particular, [the first line](https://github.com/overhangio/tutor-ecommerce/blob/master/tutorecommerce/patches/mfe-env-production#L1). That variable will be empty, and would therefore result in the weird URL you’re seeing in Olive.

---

<div class="post-metadata">

**Author:** ![ghassan](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/ghassan/32/2779_2.png) [@ghassan](https://discuss.openedx.org/u/ghassan)\
**Post date:** [December 19, 2022, 4:46pm UTC](https://discuss.openedx.org/t/potential-payment-mfe-with-olive/8948/13 "2022-12-19T16:46:44Z")

</div>

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

```auto
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

---

<div class="post-metadata">

**Author:** ![sambapete](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/sambapete/32/4100_2.png) [@sambapete](https://discuss.openedx.org/u/sambapete)\
**Post date:** [December 19, 2022, 6:25pm UTC](https://discuss.openedx.org/t/potential-payment-mfe-with-olive/8948/14 "2022-12-19T18:25:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sambapete](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/sambapete/32/4100_2.png) [@sambapete](https://discuss.openedx.org/u/sambapete)\
**Post date:** [December 19, 2022, 7:34pm UTC](https://discuss.openedx.org/t/potential-payment-mfe-with-olive/8948/15 "2022-12-19T19:34:41Z")

</div>

@ghassan The patch works perfectly. Thank you.

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

---

<div class="post-metadata">

**Author:** ![regis](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/regis/32/2640_2.png) [@regis](https://discuss.openedx.org/u/regis)\
**Post date:** [December 22, 2022, 3:55pm UTC](https://discuss.openedx.org/t/potential-payment-mfe-with-olive/8948/16 "2022-12-22T15:55:51Z")

</div>

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](https://github.com/overhangio/tutor-ecommerce/pull/36) Please report any further issue here.

---

<div class="post-metadata">

**Author:** ![regis](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/regis/32/2640_2.png) [@regis](https://discuss.openedx.org/u/regis)\
**Post date:** [March 10, 2023, 10:27am UTC](https://discuss.openedx.org/t/potential-payment-mfe-with-olive/8948/19 "2023-03-10T10:27:05Z")

</div>

A post was split to a new topic: [Payment MFE returns 404](https://discuss.openedx.org/t/payment-mfe-returns-404/9547)
