You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The "paymentmethodchange" event allow a payment handler to communicate with the merchant before the payment request completes. It involves the following interfaces:
The Payment Handler API spec is unspecific about how to turn the PaymentDetailsUpdate object the merchant provides to the PaymentRequestDetailsUpdate object the payment handler receives. Section 7.2 Change Payment Method Algorithm [1] simply says:
5. Construct and return a PaymentRequestDetailsUpdate from the detailsPromise in event.updateWith(detailsPromise).
Proposal:
I think we should either merge the two object definition, or specify clearly how to convert one object from another. We should also do the same for the "shippingaddresschange" and "shippingoptionchange" events.
The reason that both "PaymentDetailsUpdate" and "PaymentRequestDetailsUpdate" dictionaries exist is that the two dictionaries have different fields; The former inherits displayItems[1] from "PaymentDetailsBase" dictionary while displayItems is redacted in the latter (i.e. Payment handlers do not recieve displayItems).
Another difference between the two dictionaries is the type of "total" field: "PaymentItem" vs "PaymentCurrencyAmount". Again Payment Handlers get the redacted version of the total.
The third and last difference between the two is that "payerError"[2] is redacted from "PaymentRequestDetailsUpdate" since the "payerdetailchange"[3] is not implemented for Payment Handlers.
The "paymentmethodchange" event allow a payment handler to communicate with the merchant before the payment request completes. It involves the following interfaces:
The Payment Handler API spec is unspecific about how to turn the
PaymentDetailsUpdate
object the merchant provides to thePaymentRequestDetailsUpdate
object the payment handler receives. Section 7.2 Change Payment Method Algorithm [1] simply says:Proposal:
I think we should either merge the two object definition, or specify clearly how to convert one object from another. We should also do the same for the "shippingaddresschange" and "shippingoptionchange" events.
[1] https://w3c.github.io/payment-handler/#dfn-change-payment-method-algorithm
The text was updated successfully, but these errors were encountered: