diff --git a/index.html b/index.html index 2a589ace..c49c86b8 100644 --- a/index.html +++ b/index.html @@ -579,10 +579,12 @@

readonly attribute PaymentAddress? shippingAddress; readonly attribute DOMString? shippingOption; readonly attribute PaymentShippingType? shippingType; + readonly attribute PaymentAddress? payerAddress; attribute EventHandler onshippingaddresschange; attribute EventHandler onshippingoptionchange; attribute EventHandler onpaymentmethodchange; + attribute EventHandler onpayeraddresschange; };
@@ -848,6 +850,10 @@

  • Set the value of the shippingAddress attribute on request to null.
  • +
  • Set the value of the payerAddress attribute on + request to null. +
  • If options.requestShipping is set to true, then set the value of the "PaymentOptions.shippingType">shippingType member).

    +
    +

    + payerAddress attribute +

    +

    + A PaymentRequest's payerAddress attribute is populated + when the user provides a payer address (commonly referred to as a + billing address). It is null by default. When a user provides a payer + address, the payer address changed algorithm runs. +

    +

    + On some user agents, some attributes of payerAddress might be + redacted until the user accepts the payment request, at which + point all the user-provided details of payerAddress become + available. +

    +

    onshippingaddresschange attribute @@ -1326,6 +1349,16 @@

    "paymentmethodchange".

    +
    +

    + onpayeraddresschange attribute +

    +

    + A PaymentRequest's onpayeraddresschange attribute is an + EventHandler for a PaymentRequestUpdateEvent named + "payeraddresschange". +

    +

    Internal Slots @@ -1799,6 +1832,7 @@

    DOMString error; PaymentItem total; AddressErrors shippingAddressErrors; + AddressErrors payerAddressErrors; };

    @@ -1850,6 +1884,14 @@

    associated with the event target. +
    + payerAddressErrors member +
    +
    + Represents validation errors with the payer address that is + associated with the event + target. +

    @@ -1964,6 +2006,7 @@

    boolean requestPayerEmail = false; boolean requestPayerPhone = false; boolean requestShipping = false; + boolean requestPayerAddress = false; PaymentShippingType shippingType = "shipping"; }; @@ -2026,6 +2069,15 @@

    the payment request.

    +
    + requestPayerAddress member +
    +
    + A boolean that instructs the user agent to collect and return + a payer's address (also commonly referred to as a "billing address"). + A merchant can use this information to, for example, calculate tax in + certain jurisdictions. +
    @@ -3172,6 +3224,7 @@

    readonly attribute DOMString? payerName; readonly attribute DOMString? payerEmail; readonly attribute DOMString? payerPhone; + readonly attribute PaymentAddress? payerAddress; [NewObject] Promise<void> complete(optional PaymentComplete result = "unknown"); @@ -3270,8 +3323,9 @@

                 dictionary PaymentValidationErrors {
    -              PayerErrorFields payer;
    +              PayerErrors payer;
                   AddressErrors shippingAddress;
    +              AddressErrors payerAddress;
                   DOMString error;
                 };
               
    @@ -3290,6 +3344,12 @@

    shippingAddress.
    + payerAddress member +
    +
    + Represents validation errors with the PaymentResponse's + payerAddress. +
    error member
    @@ -3302,20 +3362,20 @@

    -
    +

    - PayerErrorFields dictionary + PayerErrors dictionary

    -          dictionary PayerErrorFields {
    +          dictionary PayerErrors {
                 DOMString email;
                 DOMString name;
                 DOMString phone;
               };
               

    - The PayerErrorFields is used to represent validation errors + The PayerErrors is used to represent validation errors with one or more payer details.

    @@ -3492,6 +3552,19 @@

    "PaymentRequest.id">id that spawned this payment response.

    +
    +

    + payerAddress attribute +

    +

    + If the requestPayerAddress member + was set to true in the PaymentOptions passed to the + PaymentRequest constructor, then payerAddress will be the + un-redacted payer's address chosen by the user. +

    +

    complete() method @@ -3717,6 +3790,20 @@

    payment handler. + + + payeraddresschange + + + PaymentRequestUpdateEvent + + + The user provides a new payer address. + + + PaymentRequest + +

  • +
    +

    + Payer address changed algorithm +

    +

    + The payer address changed algorithm runs when the user + provides a new payer address. It MUST run the following steps: +

    +
      +
    1. Let request be the PaymentRequest object that + the user is interacting with. +
    2. +
    3. + Queue a task on the user interaction task source to + run the following steps: +
        +
      1. +
        +

        + The redactList optionally gives user agents the + possibility to limit the amount of personal information + about the recipient that the API shares with the merchant. +

        +

        + For merchants, the resulting PaymentAddress object + provides enough information to, for example, calculate tax, + but, in most cases, not enough information to physically + locate and uniquely identify the payer. +

        +

        + Unfortunately, even with the redactList, + recipient anonymity cannot be assured. This is because in + some countries postal codes are so fine-grained that they + can uniquely identify a recipient. +

        +
        Let redactList be the empty list. Optionally, + set redactList to « "organization", "phone", + "recipient", "addressLine" ». +
      2. +
      3. Let address be the result of running the steps to + create a PaymentAddress from user-provided + input with redactList. +
      4. +
      5. Set the payerAddress attribute on + request to address. +
      6. +
      7. Run the PaymentRequest updated algorithm with + request and "payeraddresschange". +
      8. +
      +
    4. +
    +

    User accepts the payment request algorithm @@ -4301,6 +4442,28 @@

  • If the requestPayerAddress value of + request.[[\options]] is false, then set the + payerAddress attribute + value of response to null. Otherwise: +
      +
    1. Let redactList be the empty list. +
    2. +
    3. Let payerAddress be the result of create a + PaymentAddress from user-provided input with + redactList. +
    4. +
    5. Set the payerAddress attribute value + of response to payerAddress. +
    6. +
    7. Set the payerAddress attribute value of + request to payerAddress. +
    8. +
    +
  • +
  • If the requestShipping value of request.[[\options]] is true, then set the shippingOption @@ -4664,6 +4827,8 @@

    Further, if the shippingAddressErrors + or the payerAddressErrors member is present, the user agent SHOULD display an error specifically for each erroneous field of the shipping address. This is done by matching each present member of