wallee-payment / magento-2

Wallee integration for Magento 2.3 and later
https://wallee.com
Apache License 2.0
3 stars 3 forks source link

Transaction is not updated due to cached payment methods in checkout session #31

Open tudorgl opened 1 year ago

tudorgl commented 1 year ago

Preconditions:

Problem:

Expected behavior:

When accessing for the first time the checkout session in a new private window, it works correctly (the method is not available when the company field is populated while the method is available when company field is empty). However, after that, it seems that the payment method is cached in https://github.com/wallee-payment/magento-2/blob/master/Model/Service/Quote/TransactionService.php#L550 and is not refreshed when changing address data in checkout.

It seems that the event which is intended for this purpose https://github.com/wallee-payment/magento-2/blob/master/Observer/CartEventListener.php#L58 does not seem to be triggered when the shipping/billing address is changed. Could it be that Magento standard event checkout_cart_save_after is only fired when there are only cart items changes and not other quote changes such as delivery/billing address?

A quick and temporary "workaround" was to always return an empty array in https://github.com/wallee-payment/magento-2/blob/master/Model/Service/Quote/TransactionService.php#L546 so that the Wallee portal is always requested and transaction refreshed.

Thanks for checking and kind regards Tudor

theodorspringwallee commented 1 year ago

Dear tudorgl

I could reproduce the issue you described.

Our developers will fix this as soon as possible.

Best regards