Adyen / adyen-magento2

Adyen Payment plugin for Magento2
MIT License
150 stars 198 forks source link

[ECP-8983] Incompatibility with amasty/module-single-step-checkout #2492

Open mikimpe opened 5 months ago

mikimpe commented 5 months ago

Describe the bug After upgrading adyen/module-payment module from 8.17.0 to 9.0.7 we are having some issues with Amasty One Step Checkout. If you go to the checkout page while logged in with an account that already has a default shipping address saved, initially, no Adyen payment methods will be visible. However, if you change the shipping address on the checkout page to another one already saved in the account or create a new one, Adyen payment methods will become visible at that point. It seems that in the v9 Adyen payment methods initialization is bound to a function that is not called if the customer goes to the checkout with an address already selected. In the 8.17.0 we don't have this issue.

To Reproduce Steps to reproduce the behavior:

  1. Install Amasty One Step Checkout https://amasty.com/one-step-checkout-for-magento-2.html and configure it
  2. Create a customer account and set a default shipping address
  3. Go to the checkout
  4. Error: no Adyen payment methods visible

Expected behavior You can see and use Adyen payment also without changing the shipping address on the checkout page

Magento version 2.4.5-p5

Plugin version 9.0.7

Additional context If modifying https://github.com/Adyen/adyen-magento2/blob/develop/view/frontend/web/js/view/payment/adyen-methods.js initialize function from

            initialize: function () {
                this._super();

                // Virtual quote doesn't call payment-information or shipping-information endpoints.
                // payment-information endpoint should be called manually to fetch Adyen extension attributes.
                if (quote.isVirtual()) {
                    getPaymentInformation();
                }
            }

to

            initialize: function () {
                this._super();

                getPaymentInformation();
            }

the payment methods are visible and the payment process seems to work fine.

candemiralp commented 5 months ago

Hello @mikimpe,

Thank you for creating this Github issue.

Our plugin requires response coming from Adyen's Checkout API's /paymentMethods endpoint response to mount the payment method components. This extra information is passed to extension_attributes of POST shipping-information or GET payment-information endpoints.

From the case you identified, shipping-information is skipped because that information has been set already. But, as I see GET payment-information is also skipped by One Step Checkout module (Default Luma template calls that endpoint if the shopper lands on the checkout page without shipping address selection). Therefore, our module can't obtain the required extra information for components.

The solution you provided can't be applied because it will end-up with making two redundant /paymentMethods call to Adyen's Checkout API. The plugin only calls GET payment-information endpoint by getPaymentInformation() function if it's a virtual quote. Because virtual quote doesn't have a shipping and doesn't call POST shipping-information.

We are going to investigate a potential solution to prevent this issue.

Best Regards, Can

linshin commented 1 month ago

Hello @mikimpe,

We are facing the same issue after upgrading Adyen to 9.X. Did you find a solution for that issue apart from removing the quote.isVirtual() condition?

mikimpe commented 1 month ago

Hello @linshin

Nope, the only solution I found is removing the quote.isVirtual() condition

linshin commented 1 month ago

Any updates from your side on this issue? @candemiralp