Adyen / adyen-magento2-express-checkout

Adyen Magento 2 Express Checkout Module
MIT License
8 stars 2 forks source link

Apple Pay - error message never displayed #59

Open dimitriBouteille opened 7 months ago

dimitriBouteille commented 7 months ago

Describe the bug

When no delivery method is available, the following message is displayed: There are no shipping methods available for you right now. Please try again or use an alternative payment method.

https://github.com/Adyen/adyen-magento2-express-checkout/blob/cf8ef25d64120c90e7e7a7ac49719cbe884adadc/view/frontend/web/js/applepay/button.js#L261

Unfortunately this error is never displayed ...

When I check Adyen component ApplePayService and Apple Pay document, reject('My error') is not valid.

Obviously the reject function must be called with an object containing the following information :

An example that works: Adyen - Step 4: Configure the callback to handle shipping method changes

To Reproduce

:boom: Redirected back to the checkout, no error message displayed (Magento)

image

Expected behavior

Error message must be displayed in Apple Pay sheet.


Why all reject callback are called with string ? Is this on purpose?

dimitriBouteille commented 7 months ago

When no delivery method is available, Apple Pay suggests using the error with the following code: addressUnserviceable

The code that indicates that the merchant can’t provide service to the shipping address (for example, can’t deliver to a P.O. Box).

if (result.length === 0) {
    reject({
        newTotal: {
            label: this.getMerchantName(),
            amount: formatAmount(getCartSubtotal() * 100),
        },
        errors: [new ApplePayError('addressUnserviceable')],
    });
    return;
}

Why this error, Apple Pay display generic message

Capture d’écran du 2023-11-09 09-38-47

dimitriBouteille commented 6 months ago

Same issue for authorization step :(