Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tudorgl opened this issue Aug 23, 2023 · 1 comment

Comments

@tudorgl
Copy link

tudorgl commented Aug 23, 2023

Preconditions:

  • M2.4.5-p4
  • Storefront in PWA so that all the cart/checkout requests are done via graphql

Problem:

  • Payment method by "Invoice" is cached within the same checkout session
  • Wallee portal is not requested => transaction is not refreshed when address details are changed in Magento checkout

Expected behavior:

  • payment method availability should be updated depending on the address data

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
Copy link
Contributor

Dear tudorgl

I could reproduce the issue you described.

Our developers will fix this as soon as possible.

Best regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants