Add shipping methods into Apple Pay Express #117
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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