w3c / payment-request

Payment Request API
https://www.w3.org/TR/payment-request/
Other
489 stars 135 forks source link

Payment Method - BasicCardErrors.paymentMethod errors not being displayed #897

Closed rrigoni closed 4 years ago

rrigoni commented 4 years ago

Hi folks,

I'm trying to display payment method validation errors for each field. The payment request is constructed as:

const methodData = [{
            supportedMethods: "basic-card",
            data: {
                supportedNetworks: networks,
            },
        }
        ];

        const details = {
            id: "super-store-order-123-12312",
            displayItems: lineItems,
            total: {
                label: "Total",
                amount: {
                    currency: "USD",
                    value: Number.parseFloat(Number.parseFloat(lineItems[0].amount.value) + Number.parseFloat(lineItems[1].amount.value)).toFixed(2)
                },
            },
        };
const request = new PaymentRequest(methodData, details, options);

The errors in the retry promise are as follows: (dummy data)

let errors = {
                paymentMethod: {
                    cardNumber: "asd",
                    cardholderName: "asd",
                    cardSecurityCode: "asd",
                    expiryMonth: "asd",
                    expiryYear: "asd",
                    billingAddress: {
                        addressLine: "asd",
                        region: "ads",
                    }
                }
            };

PayerErrors appears in each field, but for paymentMethod it does not show anything. Only a general error message "There was an issue while trying to execute your order. Please try again.

I'm running on Google Chrome 79.0.3945.130 (Official Build) (64-bit) on a MacOs Catalina.

Thanks

rsolomakhin commented 4 years ago

Hi @rrigoni , I've addressed your comment in https://github.com/rsolomakhin/rsolomakhin.github.io/issues/39#issuecomment-583462069. TL;DR: Chrome has not implemented the paymentMethod method for retry() yet.

marcoscaceres commented 4 years ago

Closing, as this is Chrome related(?). Please let me know if that's incorrect and I'll reopen.