From cf6220348ad03abe5f27a388f37cc718197ac509 Mon Sep 17 00:00:00 2001
From: Sahel Sharify
The PaymentManager is used by payment handlers to
- manage their associated instruments and supported payment methods.
+ manage their associated instruments as well as supported payment
+ methods and delegations.
interface PaymentManager {
[SameObject] readonly attribute PaymentInstruments instruments;
attribute DOMString userHint;
+ Promise<void> enableDelegations(FrozenArray<PaymentDelegation> delegations);
};
@@ -362,6 +364,55 @@
cause confusion to display the additional hint.
+ This method allows a payment handler to asynchronously + declare its supported PaymentDelegation list. +
++ enum PaymentDelegation { + "shippingAddress", + "payerName", + "payerPhone", + "payerEmail" + }; ++
- The PaymentMethodChangeResponse
contains the updated
- total (optionally with modifiers) and possible errors resulting from
- user selection of a payment method within a payment handler.
+ The PaymentRequestDetailsUpdate
contains the updated
+ total (optionally with modifiers and shipping options) and possible
+ errors resulting from user selection of a payment method, a shipping
+ address, or a shipping option within a payment handler.
- dictionary PaymentMethodChangeResponse { + dictionary PaymentRequestDetailsUpdate { DOMString error; PaymentCurrencyAmount total; FrozenArray<PaymentDetailsModifier> modifiers; + FrozenArray<PaymentShippingOption> shippingOptions; object paymentMethodErrors; + AddressErrors shippingAddressErrors; };
- A human readable string that explains why the payment method cannot - be used. + A human readable string that explains why the user selected payment + method, shipping address or shipping option cannot be used.
- Updated total based on the changed payment method. The total can - change, for example, because the billing address of the payment - method selected by the user changes the Value Added Tax (VAT). + Updated total based on the changed payment method, shipping + address, or shipping option. The total can change, for example, + because the billing address of the payment method selected by the + user changes the Value Added Tax (VAT); Or because the shipping + option/address selected/provided by the user changes the shipping + cost.
- Updated modifiers based on the changed payment method. For example, - if the overall total has increased by €1.00 based on the billing - address, then the totals specified in each of the modifiers should - also increase by €1.00. + Updated modifiers based on the changed payment method, shipping + address, or shipping option. For example, if the overall total has + increased by €1.00 based on the billing or shipping address, then + the totals specified in each of the modifiers should also increase + by €1.00. +
++ Updated shippingOptions based on the changed shipping address. For + example, it is possible that express shipping is more expensive or + unavailable for the user provided country.
+ Validation errors for the shipping address, if any. +
++ The value of PaymentOptions in the PaymentRequest. + Available only when shippingAddress and/or any subset of payer's + contact information are requested. +
++ The value of ShippingOptions on the + PaymentDetailsInit from the corresponding + PaymentRequest. Available only when shipping address is + requested. +
++ This method is used by the payment handler to get updated payment + details given the shippingAddress. When called, it runs the + change payment details algorithm. +
++ This method is used by the payment handler to get updated payment + details given the shippingOption identifier. When called, it runs + the change payment details algorithm. +
+The topOrigin, paymentRequestOrigin, paymentRequestId, methodData, - total, modifiers, and - instrumentKey members share their definitions with those - defined for PaymentRequestEvent + total, modifiers, instrumentKey, + paymentOptions, and shippingOptions members + share their definitions with those defined for + PaymentRequestEvent
Then run the following steps in parallel, with @@ -1869,6 +2017,11 @@
+ The user provided payer's name. +
++ The user provided payer's email. +
++ The user provided payer's phone number. +
++ The user provided shipping address. +
++ The identifier of the user selected shipping option. +
++ When this algorithm is invoked with shippingAddress or + shippingOption the user agent MUST run the following + steps: +
+null
.
+