Currently when using Apple Pay Express if there are multiple shipping methods available all but the first are ignored and you cannot change your shipping method.
Changed the onShippingContactSelect to pass the full array of returned shipping methods into the afterSetTotalsInfo. This function then checks if the parameter is an array and if it is will set the newShippingMethods so that all shipping methods can be used.
The onShippingMethodSelect hasn't been changed and that still passes the single shipping method into the afterSetTotalsInfo function as we don't need to change the shipping methods on this callback.
Tested scenarios
Tested with Apple Pay using a sandbox Adyen account for delivery addresses with multiple, a single and no shipping methods available.
Summary
Currently when using Apple Pay Express if there are multiple shipping methods available all but the first are ignored and you cannot change your shipping method.
Changed the
onShippingContactSelect
to pass the full array of returned shipping methods into theafterSetTotalsInfo
. This function then checks if the parameter is an array and if it is will set thenewShippingMethods
so that all shipping methods can be used.The
onShippingMethodSelect
hasn't been changed and that still passes the single shipping method into theafterSetTotalsInfo
function as we don't need to change the shipping methods on this callback.Tested scenarios
Tested with Apple Pay using a sandbox Adyen account for delivery addresses with multiple, a single and no shipping methods available.
Adobe Commerce Version: 2.4.5-p9 Adyen Payments: 9.7.1 Adyen Express Checkout: 2.2.1
Fixes #106