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?
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