Open
Description
The "paymentmethodchange" event allow a payment handler to communicate with the merchant before the payment request completes. It involves the following interfaces:
- Payment handler side:
partial interface PaymentRequestEvent {
Promise<PaymentRequestDetailsUpdate?> changePaymentMethod(DOMString methodName, optional object? methodDetails = null);
}
- Merchant side:
partial interface PaymentRequestUpdateEvent : Event {
void updateWith(Promise<PaymentDetailsUpdate> detailsPromise);
};
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.
[1] https://w3c.github.io/payment-handler/#dfn-change-payment-method-algorithm
Metadata
Metadata
Assignees
Labels
No labels