From 36e6d65a4470c6d3f6e1ffc426b6fa34c11c6ea3 Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Fri, 28 Jun 2019 15:55:01 -0400 Subject: [PATCH 01/50] very rough sketch of requestShippingAddress() method --- index.html | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) diff --git a/index.html b/index.html index f5555b2d..c99b26a5 100644 --- a/index.html +++ b/index.html @@ -2031,6 +2031,91 @@

+
+

+ AddressParts enum +

+
+        enum AddressParts {
+          "addressLine",
+          "city",
+          "country",
+          "dependentLocality",
+          "organization",
+          "phone",
+          "postalCode",
+          "recipient",
+          "region",
+          "sortingCode"
+        };
+      
+

+ The {{AddressParts}} enum is used to represent individual parts of a + physical address. +

+
+
+ "addressLine" +
+
+ The address line. +
+
+ "city" +
+
+ The city. +
+
+ "country" +
+
+ The country. +
+
+ "dependentLocality" +
+
+ The dependent locality. +
+
+ "organization" +
+
+ The organization. +
+
+ "phone" +
+
+ The phone number. +
+
+ "postalCode" +
+
+ postal code. +
+
+ "recipient" +
+
+ The recipient. +
+
+ "region" +
+
+ The region. +
+
+ "sortingCode" +
+
+ The sorting Code. +
+
+

PaymentShippingType enum @@ -3952,6 +4037,7 @@

[SecureContext, Exposed=Window] interface PaymentRequestUpdateEvent : Event { constructor(DOMString type, optional PaymentRequestUpdateEventInit eventInitDict = {}); + Promise<PaymentAddress> requestShippingAddress(AddressParts addressParts); void updateWith(Promise<PaymentDetailsUpdate> detailsPromise); }; @@ -3981,6 +4067,39 @@

+
+

+ requestShippingAddress() method +

+ +

updateWith() method From 86af323b0bea0495780fd2edbb0d3c59b9c13f32 Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Thu, 12 Sep 2019 10:55:01 -0400 Subject: [PATCH 02/50] Use sequence instead of FrozenArray for requestShippingAddress() parameter. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Marcos Cáceres --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index c99b26a5..5616f298 100644 --- a/index.html +++ b/index.html @@ -4037,7 +4037,7 @@

[SecureContext, Exposed=Window] interface PaymentRequestUpdateEvent : Event { constructor(DOMString type, optional PaymentRequestUpdateEventInit eventInitDict = {}); - Promise<PaymentAddress> requestShippingAddress(AddressParts addressParts); + Promise<PaymentAddress> requestShippingAddress(sequence addressParts); void updateWith(Promise<PaymentDetailsUpdate> detailsPromise); }; From 167f610bacec79397f9da543b6a97c016413b9f8 Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Thu, 12 Sep 2019 10:55:22 -0400 Subject: [PATCH 03/50] Apply reviewer suggestion. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Marcos Cáceres --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 5616f298..a3dd86f8 100644 --- a/index.html +++ b/index.html @@ -4076,7 +4076,7 @@

If a developer wants to incrementally request more granular details of the user's shipping address, for example, to re-calculate shipping cost, then they can call requestShippingAddress() - and provide a list of AddressParts, which will return a + and provide a sequence of AddressParts, which will return a promise that resolves to an PaymentAddress with the requested address fields populated. This method can be called repeatedly to incrementally request more parts as needed. From 7c6233c7179033f229bd231a0e751f22464f3b5f Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Fri, 13 Sep 2019 10:45:16 -0400 Subject: [PATCH 04/50] Add asides to encourage usage of requestShippingAddress. --- index.html | 86 ++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 77 insertions(+), 9 deletions(-) diff --git a/index.html b/index.html index a3dd86f8..99fd1952 100644 --- a/index.html +++ b/index.html @@ -4037,7 +4037,7 @@

[SecureContext, Exposed=Window] interface PaymentRequestUpdateEvent : Event { constructor(DOMString type, optional PaymentRequestUpdateEventInit eventInitDict = {}); - Promise<PaymentAddress> requestShippingAddress(sequence addressParts); + Promise<PaymentAddress> requestShippingAddress(sequence<AddressParts> addressParts); void updateWith(Promise<PaymentDetailsUpdate> detailsPromise); }; @@ -4073,13 +4073,23 @@

+

+ The requestShippingAddress(|addressParts|) method MUST act as + follows: +

+
    +
  1. Let |event:PaymentRequestUpdateEvent| be this + {{PaymentRequestUpdateEvent}} instance. +
  2. +
  3. If |event|'s {{ Event.isTrusted }} attribute is false, then + [=exception/throw=] an {{"InvalidStateError"}} {{DOMException}}. +
  4. +
  5. If |event|'s [=Event/target=] is an instance of + PaymentResponse, let |request:PaymentRequest| be |event|'s + [=Event/target=].[[\request]]. +
  6. +
  7. Otherwise, let |request:PaymentRequest| be the value of + |event|'s [=Event/target=]. +
  8. +
  9. Assert: |request| is an instance of {{PaymentRequest}}. +
  10. +
  11. If |request|.[[\state]] is not "interactive", + then [=exception/throw=] an {{"InvalidStateError"}} + {{DOMException}}. +
  12. +
  13. Let |shippingAddress| be the value of |request|'s + shippingAddress + attribute. + +
  14. +
  15. Let |details| be an AddressInit dictionary with no + members present. +
  16. +
  17. For each attribute |attributeName| in |shippingAddress| +
      +
    1. Set |details|[|attributeName|] to the value of + |shippingAddress|.[[|attributeName|]] if it is not empty. +
    2. +
    +
  18. +
  19. Let |redactList| be the empty list. Set |redactList| to + « "organization", "phone", "recipient", "addressLine" ». +
  20. +
  21. For each |addressPart| in |addressParts|: +
      +
    1. If |details|[|addresPart|] is already present, continue.
    2. +
    3. If |addressPart| is not in |redactList|, set |details|[|addressPart|] + to the user provided value for this addres part. +
    4. +
    +
  22. +
  23. Internally construct + a new PaymentAddress with |details| and return the result. +
  24. +
+

From 28f206cf7769e87d01fdd28aed126321f2d3f29c Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Fri, 13 Sep 2019 11:22:54 -0400 Subject: [PATCH 05/50] Reformat and added notes to PaymentOptions section --- index.html | 59 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 21 deletions(-) diff --git a/index.html b/index.html index 99fd1952..78cf8cdd 100644 --- a/index.html +++ b/index.html @@ -2222,6 +2222,19 @@

example, this would be set to true when physical goods need to be shipped by the merchant to the user. This would be set to false for the purchase of digital goods. +
shippingType member @@ -4074,9 +4087,9 @@

+
+ requestShippingAddressParts member +
+
+ A sequence of AddressParts that indicates fine-grained parts of + the shipping address that the user agent SHOULD collect and + return. Additional pieces can be requested incrementally as needed + using PaymentRequestUpdateEvent.requestShippingAddress(). +
shippingType member
@@ -3991,6 +4016,7 @@

constructor(DOMString type, optional PaymentMethodChangeEventInit eventInitDict = {}); readonly attribute DOMString methodName; readonly attribute object? methodDetails; + Promise<object> requestBillingAddress(sequence<AddressParts> addressParts); };
@@ -4013,6 +4039,30 @@

more information.

+
+

+ requestBillingAddress() method +

+ +

@@ -4095,10 +4145,6 @@

country B, a developer should request only "country" first and decide if "region" is needed.

-

- A future version of this specification may remove the all-in-one - {{PaymentOptions.requestShipping}} boolean. -

A developer can call {{requestShippingAddress()}} repeatedly. Each call returns a promise that resolves to a {{PaymentAddress}} From b7b503f55a3a18fb84cb6281525dd89ea2ded72e Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Sun, 27 Oct 2019 22:44:54 -0400 Subject: [PATCH 07/50] Reworded request{Billing|Shipping}Address to better incorporate into existing algorithms --- index.html | 446 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 268 insertions(+), 178 deletions(-) diff --git a/index.html b/index.html index 22f01a44..55dcf226 100644 --- a/index.html +++ b/index.html @@ -890,6 +890,8 @@

  • Set |request|.[[\options]] to |options|.
  • +
  • Set |request|.[[\requestedShippingAddressParts]] to + |options|.requestShippingAddressParts.
  • Set |request|.[[\state]] to "created".
  • Set |request|.[[\updating]] to false. @@ -1137,7 +1139,9 @@

  • Pass the converted - second element in the |paymentMethod| tuple and |modifiers|. + second element in the |paymentMethod| tuple, |modifiers|, + |request|.[[\options]].requestBillingAddress and + |request|.[[\options]].requestBillingAddressParts. Optionally, the user agent SHOULD send the appropriate data from |request| to the user-selected payment handler in order to guide the user through the payment process. This includes the @@ -1490,6 +1494,20 @@

    The PaymentOptions supplied to the constructor. + + + [[\requestedShippingAddressParts]] + + + The current sequence<AddressParts> specifying + the payee-requested shipping address parts, initially supplied to + the constructor via {{PaymentOptions}}'s + + requestShippingAddressParts and then updated with calls to + + requestShippingAddress(). + + [[\state]] @@ -2181,27 +2199,32 @@

    A boolean that indicates whether the user agent SHOULD collect and return the billing address associated with a payment method (e.g., the billing address associated with a credit card). - Typically, the user agent will return the billing address as part of - the {{PaymentMethodChangeEvent}}'s methodDetails. A merchant - can use this information to, for example, calculate tax in certain - jurisdictions and update the displayed total. See below for privacy - considerations regarding exposing user - information. + The user agent returns the billing address as part of the + {{PaymentMethodChangeEvent}}'s methodDetails attribute and the + {{PaymentResponse}}'s details attribute. A payee can use this + information to, for example, calculate tax in certain jurisdictions + and update the displayed total. See below for privacy considerations + regarding exposing user information.
    requestBillingAddressParts member
    - A sequence of AddressParts that indicates fine-grained parts of - the billing address that the user agent SHOULD collect from - the user-selected payment handler. Additional pieces can be requested - incrementally using PaymentMethodChangeEvent.requestBillingAddress - . + A sequence of AddressParts that specifies which fine-grained + parts of the billing address that the payee wishes to receive when the + requestBillingAddress boolean is true. An empty list means no + restriction, i.e. the payee requests the full billing address. This + field has no effect if the requestBillingAddress boolean is + false.
    @@ -2236,19 +2259,22 @@

    A boolean that indicates whether the user agent SHOULD collect - and return a shipping address as part of the payment request. For - example, this would be set to true when physical goods need to be - shipped by the merchant to the user. This would be set to false for - the purchase of digital goods. + and return a shipping address as part of the payment request (e.g., + when physical goods need to be shipped by the payee to the user). The + user agent returns the shipping address in the + {{PaymentRequest}}'s + shippingAddress attribute and the {{PaymentResponse}}'s + shippingAddress + attribute. The former is subject to a redact list per the shipping + address changed algorithm.
    @@ -2256,10 +2282,14 @@

    requestShippingAddressParts member

  • - A sequence of AddressParts that indicates fine-grained parts of - the shipping address that the user agent SHOULD collect and - return. Additional pieces can be requested incrementally as needed - using PaymentRequestUpdateEvent.requestShippingAddress(). + A sequence of AddressParts that specifies which fine-grained + parts of the shipping address that the payee wishes to receive when + the requestShipping boolean is true. An empty list means no + restriction, i.e. the user agent will return the full shipping + address, subject to any applicable redact list. This field has no + effect if the requestShipping boolean is false. The payee can + request additional pieces incrementally using + PaymentRequestUpdateEvent.requestShippingAddress().
    shippingType member @@ -2403,6 +2433,7 @@

    [SecureContext, Exposed=(Window)] interface PaymentAddress { [Default] object toJSON(); + readonly attribute FrozenArray<DOMString> addressLine; readonly attribute DOMString city; readonly attribute DOMString country; readonly attribute DOMString dependentLocality; @@ -2412,7 +2443,6 @@

    readonly attribute DOMString recipient; readonly attribute DOMString region; readonly attribute DOMString sortingCode; - readonly attribute FrozenArray<DOMString> addressLine; };

    @@ -2530,16 +2560,6 @@

    When called, runs [[WEBIDL]]'s default toJSON operation.

    -
    -

    - country attribute -

    -

    - Represents the country of the address. When getting, returns - the value of the {{PaymentAddress}}'s [[\country]] internal - slot. -

    -

    addressLine attribute @@ -2552,21 +2572,21 @@

    - region attribute + city attribute

    - Represents the region of the address. When getting, returns - the value of the {{PaymentAddress}}'s [[\region]] internal + Represents the city of the address. When getting, returns + the value of the {{PaymentAddress}}'s [[\city]] internal slot.

    - city attribute + country attribute

    - Represents the city of the address. When getting, returns - the value of the {{PaymentAddress}}'s [[\city]] internal + Represents the country of the address. When getting, returns + the value of the {{PaymentAddress}}'s [[\country]] internal slot.

    @@ -2582,32 +2602,32 @@

    - postalCode attribute + organization attribute

    -

    - Represents the postal code of the address. When getting, +

    + Represents the organization of the address. When getting, returns the value of the {{PaymentAddress}}'s - [[\postalCode]] internal slot. + [[\organization]] internal slot.

    - sortingCode attribute + phone attribute

    - Represents the sorting code of the address. When getting, - returns the value of the {{PaymentAddress}}'s - [[\sortingCode]] internal slot. + Represents the phone number of the address. When getting, + returns the value of the {{PaymentAddress}}'s [[\phone]] + internal slot.

    - organization attribute + postalCode attribute

    -

    - Represents the organization of the address. When getting, +

    + Represents the postal code of the address. When getting, returns the value of the {{PaymentAddress}}'s - [[\organization]] internal slot. + [[\postalCode]] internal slot.

    @@ -2622,12 +2642,22 @@

    - phone attribute + region attribute +

    +

    + Represents the region of the address. When getting, returns + the value of the {{PaymentAddress}}'s [[\region]] internal + slot. +

    +
    +
    +

    + sortingCode attribute

    - Represents the phone number of the address. When getting, - returns the value of the {{PaymentAddress}}'s [[\phone]] - internal slot. + Represents the sorting code of the address. When getting, + returns the value of the {{PaymentAddress}}'s + [[\sortingCode]] internal slot.

    @@ -2738,16 +2768,16 @@

               dictionary AddressInit {
    -            DOMString country;
                 sequence<DOMString> addressLine;
    -            DOMString region;
                 DOMString city;
    +            DOMString country;
                 DOMString dependentLocality;
    -            DOMString postalCode;
    -            DOMString sortingCode;
                 DOMString organization;
    -            DOMString recipient;
                 DOMString phone;
    +            DOMString postalCode;
    +            DOMString recipient;
    +            DOMString region;
    +            DOMString sortingCode;
               };
             

    @@ -2953,7 +2983,8 @@

    The steps to create a `PaymentAddress` from user-provided input are given by the following algorithm. The algorithm takes - a list |redactList|. + a list |redactList| and a + sequence<AddressParts> |requestedParts|.

    @@ -2975,26 +3006,30 @@

      +
    1. If |requestedParts| is empty, set it to « + "addressLine", "city", "country", "dependentLocality", "organization", + "phone", "postalCode", "recipient", "region", "sortingCode"». +
    2. Let |details:AddressInit| be an AddressInit dictionary with no members present.
    3. -
    4. If "addressLine" is not in |redactList|, set - |details|["addressLine"] to the result of splitting the - user-provided address line into a list. If none was provided, - set it to the empty list. +
    5. If "addressLine" is in |requestedParts| and is not in + |redactList|, set |details|["addressLine"] to the result of + splitting the user-provided address line into a list. If none + was provided, set it to the empty list.
    6. -
    7. If "country" is not in |redactList|, set - |details|["country"] to the user-provided country as an upper - case [[ISO3166-1]] alpha-2 code, or to the empty string if none was - provided. +
    8. If "country" is in |requestedParts| and is not in |redactList|, + set |details|["country"] to the user-provided country as an + upper case [[ISO3166-1]] alpha-2 code, or to the empty string if none + was provided.
    9. -
    10. If "phone" is not in |redactList|, set |details|["phone"] - to the user-provided phone number, or to the empty string if none was - provided. +
    11. If "phone" is in |requestedParts| and is not in |redactList|, set + |details|["phone"] to the user-provided phone number, or to the + empty string if none was provided.
    12. -
    13. If "city" is not in |redactList|, set |details|["city"] to - the user-provided city, or to the empty string if none was provided. +
    14. If "city" is in |requestedParts| and is not in |redactList|, set + |details|["city"] to the user-provided city, or to the empty + string if none was provided.
    15. -
    16. If "dependentLocality" is not in |redactList|, set - |details|["dependentLocality"] to the user-provided dependent - locality, or to the empty string if none was provided. +
    17. If "dependentLocality" is in |requestedParts| and is not in + |redactList|, set |details|["dependentLocality"] to the + user-provided dependent locality, or to the empty string if none was + provided.
    18. -
    19. If "organization" is not in |redactList|, set - |details|["organization"] to the user-provided recipient - organization, or to the empty string if none was provided. +
    20. If "organization" is in |requestedParts| and is not in + |redactList|, set |details|["organization"] to the + user-provided recipient organization, or to the empty string if none + was provided.
    21. -
    22. If "postalCode" is not in |redactList|, set - |details|["postalCode"] to the user-provided postal code, or - to the empty string if none was provided. Optionally, redact part of - |details|["postalCode"]. +
    23. If "postalCode" is in |requestedParts| and is not in |redactList|, + set |details|["postalCode"] to the user-provided postal code, + or to the empty string if none was provided. Optionally, redact part + of |details|["postalCode"].

      Postal codes in certain countries can be so specific as @@ -3033,13 +3071,13 @@

    24. -
    25. If "recipient" is not in |redactList|, set - |details|["recipient"] to the user-provided recipient of the - transaction, or to the empty string if none was provided. +
    26. If "recipient" is in |requsetedParts| and is not in |redactList|, + set |details|["recipient"] to the user-provided recipient of + the transaction, or to the empty string if none was provided.
    27. - If "region" is not in |redactList|: + If "region" is in |requestedParts| and is not in |redactList|:

      @@ -3060,9 +3098,9 @@

    -
  • If "sortingCode" is not in |redactList|, set - |details|["sortingCode"] to the user-provided sorting code, or - to the empty string if none was provided. +
  • If "sortingCode" is n |requestedParts| and is not in |redactList|, + set |details|["sortingCode"] to the user-provided sorting code, + or to the empty string if none was provided.
  • Internally construct a @@ -4045,15 +4083,15 @@

    +

    + The requestBillingAddress(|addressParts|) method MUST act as + follows: +

    +
      +
    1. Let |event:PaymentMethodChangeEvent| be this + {{PaymentMethodChangeEvent}} instance. +
    2. +
    3. If |event|'s {{ Event.isTrusted }} attribute is false, then + return a promise rejected with an {{"InvalidStateError"}} + {{DOMException}}. +
    4. +
    5. Let |request:PaymentRequest| be the value of |event|'s + [=Event/target=]. +
    6. +
    7. Assert: |request| is an instance of {{PaymentRequest}}. +
    8. +
    9. If |request|.[[\state]] is not "interactive", + then return a promise rejected with an {{"InvalidStateError"}} + {{DOMException}}. +
    10. +
    11. Let |methodDetailsPromise:Promise| be a new promise.
    12. +
    13. Return |methodDetailsPromise|, and perform the remaining steps + in parallel. +
    14. +
    15. Let |handler| be the payment handler that triggered this + |event|. +
    16. +
    17. Use a payment handler specific API to send |addressParts| + to |handler| and receive a new object |methodDetails|. +

      + It is the responsibility of the payment handler to keep track of + successive address parts it is called with and return an + appropriate version of the billing address associated with the + selected payment instrument, potentially with some redact list + applied. +

      +
    18. +
    19. Resolve |methodDetailsPromise| with |methodDetails|. +
    20. + +
  • @@ -4137,10 +4217,10 @@

    - The requestShippingAddress(|addressParts|) method MUST act as + The requestShippingAddress(|addressParts|) method MUST act as follows:

    1. Let |event:PaymentRequestUpdateEvent| be this {{PaymentRequestUpdateEvent}} instance.
    2. +
    3. If |event|'s {{ Event.type }} attribute is not + shippingaddresschange, then return a promise rejected with + a {{TypeError}}. +
    4. Let |request:PaymentRequest| be the value of |event|'s + [=Event/target=]. +
    5. +
    6. Assert: |request| is an instance of {{PaymentRequest}}. +
    7. If |event|'s {{ Event.isTrusted }} attribute is false, then return a promise rejected with an {{"InvalidStateError"}} {{DOMException}}.
    8. -
    9. If |event|'s [=Event/target=] is an instance of - PaymentResponse, let |request:PaymentRequest| be |event|'s - [=Event/target=].[[\request]]. -
    10. -
    11. Otherwise, let |request:PaymentRequest| be the value of - |event|'s [=Event/target=]. -
    12. -
    13. Assert: |request| is an instance of {{PaymentRequest}}. -
    14. If |request|.[[\state]] is not "interactive", then return a promise rejected with an {{"InvalidStateError"}} {{DOMException}}.
    15. -
    16. Let |shippingAddressPromise:Promise| be a new promise.
    17. -
    18. Return |shippingAddressPromise|, and perform the remaining steps in - parallel. +
    19. Let |addressPromise:Promise| be a new promise.
    20. +
    21. Return |addressPromise|, and perform the remaining steps + in parallel.
    22. -
    23. Let |shippingAddress:PaymentAddress| be |request|'s - [=PaymentRequest/shippingAddress=]. - +
    24. Update |request|.[[\requestedShippingAddressParts]] to be + the union of itself and |addressParts|.
    25. -
    26. Let |details:AddressInit| be an {{AddressInit}} dictionary with - no members present. +
    27. Let |redactList:list| be the result of get redact list for + shipping address changed algorithm.
    28. -
    29. For each attribute |attributeName| in |shippingAddress:PaymentAddress|: -
        -
      1. Set |details|[|attributeName|] to the value of - |shippingAddress|.[[|attributeName|]] if it is not empty. -
      2. -
      -
    30. -
    31. Let |redactList| be the empty list. Set |redactList| to - « "organization", "phone", "recipient", "addressLine" ». +
    32. Let |address:PaymentAddress| be the result of create + a `PaymentAddress` from user-provided input with |redactList| + and |request|.[[\requestedShippingAddressParts]].
    33. -
    34. For each |addressPart| in |addressParts|: -
        -
      1. If |details|[|addresPart|] is already present, continue.
      2. -
      3. If |addressPart| is in |redactList|, continue.
      4. -
      5. Set |details|[|addressPart|] to the user provided value.
      6. -
      +
    35. Set |request|.[=PaymentRequest/shippingAddress=] to |address|.
    36. -
    37. Internally construct - a new PaymentAddress with |details| and resolve - |shippingAddressPromise| with the result. +
    38. Resolve |addressPromise| with |address|.

    @@ -4536,6 +4609,41 @@

    +
    +

    + Get redact list for shipping address changed algorithm +

    +

    This algorithm returns a redact list that should be used on a + shipping address returned to the payee during the + shippingaddresschange event. +

    +
    +

    + The |redactList| limits the amount of personal information + about the recipient that the API shares with the merchant before + the payment request is completed. +

    +

    + For merchants, the resulting {{PaymentAddress}} object + provides enough information to, for example, calculate + shipping costs, but, in most cases, not enough information + to physically locate and uniquely identify the recipient. +

    +

    + 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. +

    +
    +
      +
    1. Let |redactList:list| be the empty list. Set |redactList| to + « "organization", "phone", "recipient", "addressLine" ». +
    2. +
    3. Return |redactList|. +
    4. +
    +

    Shipping address changed algorithm @@ -4553,32 +4661,13 @@

    Queue a task on the user interaction task source to run the following steps:
      -
    1. -
      -

      - The |redactList| limits 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 - shipping costs, but, in most cases, not enough information - to physically locate and uniquely identify the recipient. -

      -

      - 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. -

      -
      -
    2. -
    3. Let |redactList:list| be the empty list. Set |redactList| to - « "organization", "phone", "recipient", "addressLine" ». +
    4. Let |redactList:list| be the result of get redact list for + shipping address changed algorithm.
    5. Let |address:PaymentAddress| be the result of running the steps to create a `PaymentAddress` from user-provided - input with |redactList|. + input with |redactList| and + |request|.[[\requestedShippingAddressParts]].
    6. Set the shippingAddress attribute on @@ -4847,7 +4936,8 @@

    7. Let |shippingAddress:PaymentAddress| be the result of create a `PaymentAddress` from user-provided input with - |redactList|. + |redactList| and + |request|.[[\requestedShippingAddressParts]].
    8. Set the {{shippingAddress}} attribute value of |response| to |shippingAddress|. From f037a39598bf5c000ba4cfef885b012b265a9fd2 Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Mon, 4 Nov 2019 21:49:37 -0500 Subject: [PATCH 08/50] Update index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Marcos Cáceres --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 55dcf226..cb261a68 100644 --- a/index.html +++ b/index.html @@ -1140,7 +1140,7 @@

      Pass the converted second element in the |paymentMethod| tuple, |modifiers|, - |request|.[[\options]].requestBillingAddress and + |request|.[[\options]].{{PaymentOptions/requestBillingAddress}} and |request|.[[\options]].requestBillingAddressParts. Optionally, the user agent SHOULD send the appropriate data from |request| to the user-selected payment handler in order to From 8648042ca0127e694dfd679bb1fa9549c3705824 Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Mon, 4 Nov 2019 21:49:50 -0500 Subject: [PATCH 09/50] Update index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Marcos Cáceres --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index cb261a68..58c7a510 100644 --- a/index.html +++ b/index.html @@ -1141,7 +1141,7 @@

      Pass the converted second element in the |paymentMethod| tuple, |modifiers|, |request|.[[\options]].{{PaymentOptions/requestBillingAddress}} and - |request|.[[\options]].requestBillingAddressParts. + |request|.[[\options]].{{PaymentOptions/requestBillingAddressParts}}. Optionally, the user agent SHOULD send the appropriate data from |request| to the user-selected payment handler in order to guide the user through the payment process. This includes the From f7a2b96c55c5b534e39df7355099e3f8a838bf66 Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Mon, 4 Nov 2019 21:49:57 -0500 Subject: [PATCH 10/50] Update index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Marcos Cáceres --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 58c7a510..dd1d564f 100644 --- a/index.html +++ b/index.html @@ -1499,7 +1499,7 @@

      [[\requestedShippingAddressParts]] - The current sequence<AddressParts> specifying + The current sequence<{{AddressParts}}> specifying the payee-requested shipping address parts, initially supplied to the constructor via {{PaymentOptions}}'s From 3b8c4bb9386b393b6e36f995e49de6bc668936c6 Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Mon, 4 Nov 2019 21:50:24 -0500 Subject: [PATCH 11/50] Update index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Marcos Cáceres --- index.html | 1 - 1 file changed, 1 deletion(-) diff --git a/index.html b/index.html index dd1d564f..b2f4b5e2 100644 --- a/index.html +++ b/index.html @@ -1502,7 +1502,6 @@

      The current sequence<{{AddressParts}}> specifying the payee-requested shipping address parts, initially supplied to the constructor via {{PaymentOptions}}'s - requestShippingAddressParts and then updated with calls to requestShippingAddress(). From 6cdff8011721c22edd935c5e1959690a463443c3 Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Mon, 4 Nov 2019 21:50:31 -0500 Subject: [PATCH 12/50] Update index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Marcos Cáceres --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index b2f4b5e2..ff7890d1 100644 --- a/index.html +++ b/index.html @@ -1502,7 +1502,7 @@

      The current sequence<{{AddressParts}}> specifying the payee-requested shipping address parts, initially supplied to the constructor via {{PaymentOptions}}'s - requestShippingAddressParts and then updated with calls to + {{PaymentOptions/requestShippingAddressParts}} and then updated with calls to requestShippingAddress(). From 8567e29d4c4c2b4cd76457c1dfd7fa7b077c56fe Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Mon, 4 Nov 2019 21:50:46 -0500 Subject: [PATCH 13/50] Update index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Marcos Cáceres --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index ff7890d1..2527a03b 100644 --- a/index.html +++ b/index.html @@ -4087,7 +4087,7 @@

      billing address that were not initially requested in {{ PaymentOptions.requestBillingAddressParts }}.

      -
      +            
                     request.onpaymentmethodchange = ev => {
                       const promiseForUpdatingTax =
                         ev.requestBillingAddress(["country", "postalCode"])
      
      From 96d3ad8f1e6e57d6344c3b26f00a86f4aa52cb13 Mon Sep 17 00:00:00 2001
      From: Danyao Wang 
      Date: Mon, 4 Nov 2019 21:50:53 -0500
      Subject: [PATCH 14/50] Update index.html
      MIME-Version: 1.0
      Content-Type: text/plain; charset=UTF-8
      Content-Transfer-Encoding: 8bit
      
      Co-Authored-By: Marcos Cáceres 
      ---
       index.html | 2 +-
       1 file changed, 1 insertion(+), 1 deletion(-)
      
      diff --git a/index.html b/index.html
      index 2527a03b..eac3752c 100644
      --- a/index.html
      +++ b/index.html
      @@ -4107,7 +4107,7 @@ 

    9. Let |event:PaymentMethodChangeEvent| be this {{PaymentMethodChangeEvent}} instance.
    10. -
    11. If |event|'s {{ Event.isTrusted }} attribute is false, then +
    12. If |event|'s {{ Event/isTrusted }} attribute is false, then return a promise rejected with an {{"InvalidStateError"}} {{DOMException}}.
    13. From 7005bd7e73be5a709fbbd28488305fc822807f39 Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Mon, 4 Nov 2019 21:51:02 -0500 Subject: [PATCH 15/50] Update index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Marcos Cáceres --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index eac3752c..31354bc7 100644 --- a/index.html +++ b/index.html @@ -4266,7 +4266,7 @@

    14. Let |event:PaymentRequestUpdateEvent| be this {{PaymentRequestUpdateEvent}} instance.
    15. -
    16. If |event|'s {{ Event.type }} attribute is not +
    17. If |event|'s {{ Event/type }} attribute is not shippingaddresschange, then return a promise rejected with a {{TypeError}}.
    18. Let |request:PaymentRequest| be the value of |event|'s From bd7d71deb7d3c255e7e2f8b0dfb4fe917986a2f9 Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Mon, 4 Nov 2019 21:51:09 -0500 Subject: [PATCH 16/50] Update index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Marcos Cáceres --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 31354bc7..ad9557c0 100644 --- a/index.html +++ b/index.html @@ -4274,7 +4274,7 @@

    19. Assert: |request| is an instance of {{PaymentRequest}}.
    20. -
    21. If |event|'s {{ Event.isTrusted }} attribute is false, then +
    22. If |event|'s {{ Event/isTrusted }} attribute is false, then return a promise rejected with an {{"InvalidStateError"}} {{DOMException}}.
    23. From b8d5a1a52647b470d65d0cda24e0985fda534548 Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Mon, 4 Nov 2019 23:29:44 -0500 Subject: [PATCH 17/50] Update index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Marcos Cáceres --- index.html | 1 - 1 file changed, 1 deletion(-) diff --git a/index.html b/index.html index ad9557c0..d6cc6967 100644 --- a/index.html +++ b/index.html @@ -1503,7 +1503,6 @@

      the payee-requested shipping address parts, initially supplied to the constructor via {{PaymentOptions}}'s {{PaymentOptions/requestShippingAddressParts}} and then updated with calls to - requestShippingAddress(). From 347765173a7e3f0c5337a74dd4d555d311c34f08 Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Mon, 4 Nov 2019 23:29:58 -0500 Subject: [PATCH 18/50] Update index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Marcos Cáceres --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index d6cc6967..45db6f1e 100644 --- a/index.html +++ b/index.html @@ -1503,7 +1503,7 @@

      the payee-requested shipping address parts, initially supplied to the constructor via {{PaymentOptions}}'s {{PaymentOptions/requestShippingAddressParts}} and then updated with calls to - requestShippingAddress(). + {{PaymentRequestUpdateEvent/requestShippingAddress()}}. From bfb61f5db45176a825d8093285bae1b81ac77867 Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Mon, 4 Nov 2019 23:30:14 -0500 Subject: [PATCH 19/50] Update index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Marcos Cáceres --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 45db6f1e..78eed305 100644 --- a/index.html +++ b/index.html @@ -2069,7 +2069,7 @@

      The {{AddressParts}} enum is used to represent individual parts of a physical address.

      -
      +
      "addressLine"
      From 1c704b3050be63c36e5f8dad216432ec6838498c Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Mon, 4 Nov 2019 23:30:38 -0500 Subject: [PATCH 20/50] Update index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Marcos Cáceres --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 78eed305..f6643f81 100644 --- a/index.html +++ b/index.html @@ -2198,7 +2198,7 @@

      and return the billing address associated with a payment method (e.g., the billing address associated with a credit card). The user agent returns the billing address as part of the - {{PaymentMethodChangeEvent}}'s methodDetails attribute and the + {{PaymentMethodChangeEvent}}'s {{PaymentMethodChangeEvent/methodDetails}} attribute and the {{PaymentResponse}}'s details attribute. A payee can use this information to, for example, calculate tax in certain jurisdictions and update the displayed total. See below for privacy considerations From fffefde460f29ad688ef3115db910ed332249254 Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Mon, 4 Nov 2019 23:30:49 -0500 Subject: [PATCH 21/50] Update index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Marcos Cáceres --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index f6643f81..ba55d51a 100644 --- a/index.html +++ b/index.html @@ -2199,7 +2199,7 @@

      method (e.g., the billing address associated with a credit card). The user agent returns the billing address as part of the {{PaymentMethodChangeEvent}}'s {{PaymentMethodChangeEvent/methodDetails}} attribute and the - {{PaymentResponse}}'s details attribute. A payee can use this + {{PaymentResponse}}'s {{PaymentResponse/details}} attribute. A payee can use this information to, for example, calculate tax in certain jurisdictions and update the displayed total. See below for privacy considerations regarding exposing user information. From 9204c1f9e83d7cb6828cd37bcc24549405f97282 Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Mon, 4 Nov 2019 23:31:00 -0500 Subject: [PATCH 22/50] Update index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Marcos Cáceres --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index ba55d51a..71570ea3 100644 --- a/index.html +++ b/index.html @@ -2202,7 +2202,7 @@

      {{PaymentResponse}}'s {{PaymentResponse/details}} attribute. A payee can use this information to, for example, calculate tax in certain jurisdictions and update the displayed total. See below for privacy considerations - regarding exposing user information. + regarding [[[#user-info]]].
      requestBillingAddressParts member From 3a0014bfc596656d8436fa2473039bc1c0e9afb7 Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Mon, 4 Nov 2019 23:31:10 -0500 Subject: [PATCH 23/50] Update index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Marcos Cáceres --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 71570ea3..24b191de 100644 --- a/index.html +++ b/index.html @@ -2208,7 +2208,7 @@

      requestBillingAddressParts member

      - A sequence of AddressParts that specifies which fine-grained + A sequence of {{AddressParts}} that specifies which fine-grained parts of the billing address that the payee wishes to receive when the requestBillingAddress boolean is true. An empty list means no restriction, i.e. the payee requests the full billing address. This From 27e8ddc038c4dc76f41dc4b76fc5673bc813a1b7 Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Mon, 4 Nov 2019 23:31:22 -0500 Subject: [PATCH 24/50] Update index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Marcos Cáceres --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 24b191de..8cc06187 100644 --- a/index.html +++ b/index.html @@ -2210,7 +2210,7 @@

      A sequence of {{AddressParts}} that specifies which fine-grained parts of the billing address that the payee wishes to receive when the - requestBillingAddress boolean is true. An empty list means no + requestBillingAddress member is true. An empty list means no restriction, i.e. the payee requests the full billing address. This field has no effect if the requestBillingAddress boolean is false. From a03bdf2afddade763b1238850f2b637fb0edb5f6 Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Mon, 4 Nov 2019 23:31:42 -0500 Subject: [PATCH 25/50] Update index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Marcos Cáceres --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 8cc06187..0f179b0d 100644 --- a/index.html +++ b/index.html @@ -2212,7 +2212,7 @@

      parts of the billing address that the payee wishes to receive when the requestBillingAddress member is true. An empty list means no restriction, i.e. the payee requests the full billing address. This - field has no effect if the requestBillingAddress boolean is + field has no effect if the requestBillingAddress member is false.

      From 2a3a327da3434096d1c9389dcf4f452942926db8 Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Mon, 4 Nov 2019 23:32:12 -0500 Subject: [PATCH 27/50] Update index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Marcos Cáceres --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index e6d0999d..aafbc492 100644 --- a/index.html +++ b/index.html @@ -2260,7 +2260,7 @@

      and return a shipping address as part of the payment request (e.g., when physical goods need to be shipped by the payee to the user). The user agent returns the shipping address in the - {{PaymentRequest}}'s + {{PaymentRequest}}'s {{PaymentRequest/shippingAddress}} shippingAddress attribute and the {{PaymentResponse}}'s shippingAddress attribute. The former is subject to a redact list per the shipping From dc29a17bda3389a48584e0b4da71c684314880eb Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Mon, 4 Nov 2019 23:32:32 -0500 Subject: [PATCH 28/50] Update index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Marcos Cáceres --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index aafbc492..2f608dec 100644 --- a/index.html +++ b/index.html @@ -4081,7 +4081,7 @@

    -
  • If "sortingCode" is n |requestedParts| and is not in |redactList|, +
  • If "sortingCode" is in |requestedParts| and is not in |redactList|, set |details|["sortingCode"] to the user-provided sorting code, or to the empty string if none was provided.
  • From f39882d5880a6ab48d2af0c431a3270e40b95de4 Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Mon, 4 Nov 2019 23:33:47 -0500 Subject: [PATCH 33/50] Update index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Marcos Cáceres --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index de9f20e4..3601fb4d 100644 --- a/index.html +++ b/index.html @@ -2287,7 +2287,7 @@

    address, subject to any applicable redact list. This field has no effect if the requestShipping boolean is false. The payee can request additional pieces incrementally using - PaymentRequestUpdateEvent.requestShippingAddress(). + {{PaymentRequestUpdateEvent}}'s {{PaymentRequestUpdateEvent/requestShippingAddress()}}.
    shippingType member From 663ad79852a1bdcbe7f0f4cbb0ba7b06e970cb4b Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Mon, 4 Nov 2019 23:34:00 -0500 Subject: [PATCH 34/50] Update index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Marcos Cáceres --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 3601fb4d..fd933da4 100644 --- a/index.html +++ b/index.html @@ -2285,7 +2285,7 @@

    the requestShipping member is true. An empty list means no restriction, i.e. the user agent will return the full shipping address, subject to any applicable redact list. This field has no - effect if the requestShipping boolean is false. The payee can + effect if the requestShipping member is false. The payee can request additional pieces incrementally using {{PaymentRequestUpdateEvent}}'s {{PaymentRequestUpdateEvent/requestShippingAddress()}}. From 62c3122a3f28e518ff0f11b9d3ff494bd2189628 Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Mon, 4 Nov 2019 23:52:34 -0500 Subject: [PATCH 35/50] Add link for redact list --- index.html | 54 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/index.html b/index.html index fd933da4..db75355c 100644 --- a/index.html +++ b/index.html @@ -2220,9 +2220,10 @@

    requestBillingAddressParts to the payment handler. It is the responsibility of the payment handler to ensure no more than the requested pieces is returned. A payment handler may choose to not - return some requested pieces (e.g., as a result of applying a redact - list). The payee can request additional pieces incrementally using - {{PaymentMethodChangeEvent}}'s {{PaymentMethodChangeEvent/requestBillingAddres()}}. + return some requested pieces (e.g., as a result of applying a + redact list). The payee can request additional pieces + incrementally using {{PaymentMethodChangeEvent}}'s + {{PaymentMethodChangeEvent/requestBillingAddress()}}.
    @@ -2263,8 +2264,9 @@

    {{PaymentRequest}}'s {{PaymentRequest/shippingAddress}} attribute and the {{PaymentResponse}}'s {{PaymentResponse/shippingAddress}} - attribute. The former is subject to a redact list per the shipping - address changed algorithm. + attribute. The former is subject to a + redact list per the + shipping address changed algorithm.

    - requestBillingAddress() method + + requestBillingAddress() + method

    - requestShippingAddress() method + + requestShippingAddress() + method

    - Get redact list for shipping address changed algorithm + + Get redact list for shipping address changed algorithm +

    This algorithm returns a redact list that should be used on a shipping address returned to the payee during the @@ -5598,11 +5608,11 @@

    payment method and might include:

      -
    • Use of a "|redactList|" for physical addresses. The - current specification makes use of a "|redactList|" to redact the - address line, organization, phone number, and - recipient from a shippingAddress. +
    • Use of a "redactList" for + physical addresses. The current specification makes use of a + "|redactList|" to redact the address line, organization, + phone number, and recipient from a shippingAddress.
    • Support for instructions from the payee identifying specific elements to exclude or include from the payment method From ff6e09256492113ccd4f8e9715c216f691acb596 Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Tue, 5 Nov 2019 01:35:01 -0500 Subject: [PATCH 36/50] Scope request*Address() to inside updateWith() --- index.html | 66 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 46 insertions(+), 20 deletions(-) diff --git a/index.html b/index.html index db75355c..5ffbf3d0 100644 --- a/index.html +++ b/index.html @@ -4094,13 +4094,13 @@

                     request.onpaymentmethodchange = ev => {
      -                const promiseForUpdatingTax =
      +                // ✅ Good: request finer-grained address parts inside updateWith()
      +                ev.updateWith(new Promise((resolver) => {
                         ev.requestBillingAddress(["country", "postalCode"])
      -                      .then(methodDetails => {
      -                        const promiseForUpdate = getNewTotal(methodDetails);
      -                        return promiseForUpdate;
      -                      });
      -                  ev.updateWith(promiseForUpdatingTax);
      +                    .then(methodDetails => {
      +                      resolver(getNewTotal(methodDetails));
      +                    });
      +                }));
                     };
                   
      @@ -4125,6 +4125,10 @@

      then return a promise rejected with an {{"InvalidStateError"}} {{DOMException}}.

    • +
    • If |event|.[[\waitForUpdate]] is false, + then return a promise rejected with an {{"InvalidStateError"}} + {{DOMException}}. +
    • Let |methodDetailsPromise:Promise| be a new promise.
    • Return |methodDetailsPromise|, and perform the remaining steps in parallel. @@ -4242,27 +4246,45 @@

      // ✅ Good - Request additional address parts to recompute // shipping cost. The final response.shippingAddress will also // only contain "country" and "postalCode". - request.onshippingaddresschange = ev => { - const promiseForUpdatingShippingCost = - ev.requestShippingAddress(["country", "postalCode"]) - .then(address => { - const promiseForUpdate = getNewDetails(address); - return promiseForUpdate; - }); - ev.updateWith(promiseForUpdatingShippingCost); + request.onshippingaddresschange = (ev) => { + ev.updateWith(new Promise((resolver) => { + ev.requestShippingAddress(["country", "postalCode"]) + .then(address => { + resolver(getNewDetails(address)); + }); + })); }; // ✅ Good - Request additional addresss parts to be included in // the final response.shippingAddress. - request.onshippingaddresschange = ev => { + request.onshippingaddresschange = (ev) => { // Compute shipping cost based on initial coarse address. - ev.updateWith(computeShippingCost(ev.target.shippingAddress)); + ev.updateWith(new Promise((resolver) => { + // Discard the returned promise because the full address is not + // needed until the final PaymentResponse. Empty addressParts + // means all parts are requested. + ev.requestShippingAddress(/* addressParts= */[]); - // Discard the returned promise because the full address is not - // needed until the final PaymentResponse. Empty addressParts - // means all parts are requested. - ev.requestShippingAddress(/* addressParts= */[]); + // Compute shipping cost using initial partial address. + resolver(computeShippingCost(ev.target.shippingAddress))); + }); } + + // ❌ Bad - this won't work! + request.onshippingaddresschange = (ev) => { + ev.updateWith(getPromiseForNewDetails(ev.target.shippingAddress)); + + // This will throw InvalidStateError since not inside updateWith(). + ev.requestShippingAddress([]); + }; + + // ❌ Bad - this won't work! + request.onshippingaddresschange = (ev) => { + // This will throw InvalidStateError since not inside updateWith(). + ev.requestShippingAddress([]); + + ev.updateWith(getPromiseForNewDetails(ev.target.shippingAddress)); + };

      @@ -4289,6 +4311,10 @@

      then return a promise rejected with an {{"InvalidStateError"}} {{DOMException}}.

    • +
    • If |event|.[[\waitForUpdate]] is false, + then return a promise rejected with an {{"InvalidStateError"}} + {{DOMException}}. +
    • Let |addressPromise:Promise| be a new promise.
    • Return |addressPromise|, and perform the remaining steps in parallel. From a4b426fec7cccc0f3edda2b3efb0c53c4bb32acb Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Tue, 12 Nov 2019 19:27:38 -0500 Subject: [PATCH 37/50] Update index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Marcos Cáceres --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 5ffbf3d0..c8d8f174 100644 --- a/index.html +++ b/index.html @@ -891,7 +891,7 @@

    • Set |request|.[[\options]] to |options|.
    • Set |request|.[[\requestedShippingAddressParts]] to - |options|.requestShippingAddressParts. + |options|.{{PaymentOptions/requestShippingAddressParts}}.
    • Set |request|.[[\state]] to "created".
    • Set |request|.[[\updating]] to false. From 1cc87454b39658f7a5e913ac61093bfa091e49d0 Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Tue, 12 Nov 2019 19:28:45 -0500 Subject: [PATCH 38/50] Update index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Marcos Cáceres --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index c8d8f174..789d90c7 100644 --- a/index.html +++ b/index.html @@ -2265,7 +2265,7 @@

      attribute and the {{PaymentResponse}}'s {{PaymentResponse/shippingAddress}} attribute. The former is subject to a - redact list per the + shipping redact list per the shipping address changed algorithm.

    +
    +

    + Internal Slots +

    +

    + Instances of {{PaymentMethodChangeEvent}} are created with the + internal slots in the following table: +

    + + + + + + + + + +
    + Internal Slot + + Description (non-normative) +
    + [[\waitForMethodDetails]] + + A boolean indicating whether there is a pending request for + a method-specific details object initiated by + requestBillingAddress() that has not settled. +
    +
    @@ -4226,66 +4294,16 @@

    The requestShippingAddress(|addressParts|) method MUST act as @@ -4303,18 +4321,16 @@

  • Assert: |request| is an instance of {{PaymentRequest}}.
  • -
  • If |event|'s {{ Event/isTrusted }} attribute is false, then - return a promise rejected with an {{"InvalidStateError"}} - {{DOMException}}. -
  • -
  • If |request|.[[\state]] is not "interactive", - then return a promise rejected with an {{"InvalidStateError"}} - {{DOMException}}. -
  • -
  • If |event|.[[\waitForUpdate]] is false, - then return a promise rejected with an {{"InvalidStateError"}} - {{DOMException}}. +
  • If any of the following is true, then return a promise + rejected with an {{"InvalidStateError"}} {{DOMException}}: +
  • +
  • Set |event|.[[\waitForShippingAddress]] to true.
  • Let |addressPromise:Promise| be a new promise.
  • Return |addressPromise|, and perform the remaining steps in parallel. @@ -4322,19 +4338,17 @@

  • Update |request|.[[\requestedShippingAddressParts]] to be the union of itself and |addressParts|.
  • -
  • Let |redactList:list| be the result of get redact list for - shipping address changed algorithm. -
  • Let |address:PaymentAddress| be the result of create - a `PaymentAddress` from user-provided input with |redactList| - and |request|.[[\requestedShippingAddressParts]]. + a `PaymentAddress` from user-provided input with shipping + redact list and |request|.[[\requestedShippingAddressParts]] + .
  • Set |request|.[=PaymentRequest/shippingAddress=] to |address|.
  • +
  • Set |event|.[[\waitForShippingAddress]] to false.
  • Resolve |addressPromise| with |address|.
  • -

  • @@ -4431,7 +4445,7 @@

  • Set |event|.[[\waitForUpdate]] to true.
  • -
  • Let |pmi:URL?| be null. +
  • Let |pmi:URL| be null.
  • If |event| has a methodName attribute, set |pmi| to @@ -4469,6 +4483,15 @@

    update is currently in progress. + + + [[\waitForShippingAddress]] + + + A boolean indicating whether there is a pending + requestShippingAddress() call that has not settled. + +

  • @@ -4642,41 +4665,10 @@

    -

    - - Get redact list for shipping address changed algorithm - -

    -

    This algorithm returns a redact list that should be used on a - shipping address returned to the payee during the - shippingaddresschange event. +

    Shipping redact list

    +

    The shipping redact list is a redact list that + includes « "organization", "phone", "recipient", "addressLine" ».

    -
    -

    - The |redactList| limits the amount of personal information - about the recipient that the API shares with the merchant before - the payment request is completed. -

    -

    - For merchants, the resulting {{PaymentAddress}} object - provides enough information to, for example, calculate - shipping costs, but, in most cases, not enough information - to physically locate and uniquely identify the recipient. -

    -

    - 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. -

    -
    -
      -
    1. Let |redactList:list| be the empty list. Set |redactList| to - « "organization", "phone", "recipient", "addressLine" ». -
    2. -
    3. Return |redactList|. -
    4. -

    @@ -4695,12 +4687,9 @@

    Queue a task on the user interaction task source to run the following steps:
      -
    1. Let |redactList:list| be the result of get redact list for - shipping address changed algorithm. -
    2. Let |address:PaymentAddress| be the result of running the steps to create a `PaymentAddress` from user-provided - input with |redactList| and + input with shipping redact list and |request|.[[\requestedShippingAddressParts]].
    3. Set the
      • Use of a "redactList" for physical addresses. The current specification makes use of a - "|redactList|" to redact the address line, organization, - phone number, and recipient from a shippingAddress. + shipping redact list to redact detailed address parts from a + shippingAddress.
      • Support for instructions from the payee identifying specific elements to exclude or include from the payment method From 35760166e5e63202b32f77cbe751b2ad225754e9 Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Tue, 12 Nov 2019 23:13:47 -0500 Subject: [PATCH 45/50] Add PaymentMethodChangeEvent.constructor --- index.html | 41 ++++++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/index.html b/index.html index 3b3159ec..9d579f9c 100644 --- a/index.html +++ b/index.html @@ -4057,6 +4057,27 @@

        Promise<object> requestBillingAddress(sequence<AddressParts> addressParts); }; +
        +

        + + Constructor + +

        +

        + The PaymentMethodChangeEvent(|type|, + |eventInitDict|) constructor MUST act as follows: +

        +
          +
        1. Let |event:PaymentMethodChangeEvent| be the result of calling + the [=Event/constructor=] of {{PaymentMethodChangeEvent}} with + |type| and |eventInitDict|. +
        2. +
        3. Set |event|.[[\waitForMethodDetails]] to false. +
        4. Return |event|. +
        5. +
        +

        methodDetails attribute @@ -4267,7 +4288,8 @@

        Constructor + "PaymentRequestUpdateEvent.PaymentRequestUpdateEvent()">Constructor +

        @@ -4282,6 +4304,7 @@

      • Set |event|.[[\waitForUpdate]] to false.
      • +
      • Set |event|.[[\waitForShippingAddress]] to false.
      • Return |event|.
    @@ -4457,6 +4480,14 @@

    +
    +

    + PaymentRequestUpdateEventInit dictionary +

    +
    +            dictionary PaymentRequestUpdateEventInit : EventInit {};
    +          
    +

    Internal Slots @@ -4494,14 +4525,6 @@

    -
    -

    - PaymentRequestUpdateEventInit dictionary -

    -
    -            dictionary PaymentRequestUpdateEventInit : EventInit {};
    -          
    -
    From a0fcb36c3fb0fcd91cf47703663794a3613c54f6 Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Wed, 13 Nov 2019 01:31:14 -0500 Subject: [PATCH 46/50] Update index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Marcos Cáceres --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 9d579f9c..a2624e41 100644 --- a/index.html +++ b/index.html @@ -4109,7 +4109,7 @@

    The {{PaymentMethodChangeEvent/requestBillingAddress()}} method allows the developer to incrementally request additional pieces of the billing address that were not initially requested in - {{ PaymentOptions.requestBillingAddressParts }}. + {{ PaymentOptions/requestBillingAddressParts }}.

    
    From 12d30c255a583407dcdf22323e005ef039174d51 Mon Sep 17 00:00:00 2001
    From: Danyao Wang 
    Date: Wed, 13 Nov 2019 01:31:37 -0500
    Subject: [PATCH 47/50] Update index.html
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    
    Co-Authored-By: Marcos Cáceres 
    ---
     index.html | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/index.html b/index.html
    index a2624e41..0510a3bd 100644
    --- a/index.html
    +++ b/index.html
    @@ -2984,7 +2984,7 @@ 

    The steps to create a `PaymentAddress` from user-provided input are given by the following algorithm. The algorithm takes a list |redactList| and a - sequence<AddressParts> |requestedParts|. + sequence<{{AddressParts}}> |requestedParts|.

    From 32f50df4f69f06362daedc62462f41e0d82c4e66 Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Wed, 13 Nov 2019 01:31:49 -0500 Subject: [PATCH 48/50] Update index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Marcos Cáceres --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 0510a3bd..d6dd8507 100644 --- a/index.html +++ b/index.html @@ -2287,7 +2287,7 @@

    restriction, i.e. the user agent will return the full shipping address, subject to the shipping redact list. This field has no effect if the - requestShipping member is false. The payee can request + {{PaymentOptions/requestShipping}} member is false. The payee can request additional pieces incrementally using {{PaymentRequestUpdateEvent}}'s {{PaymentRequestUpdateEvent/requestShippingAddress()}}. From fa7d1c6aa5996a9c114031e522e1e2241009aaf6 Mon Sep 17 00:00:00 2001 From: Danyao Wang Date: Wed, 13 Nov 2019 01:31:58 -0500 Subject: [PATCH 49/50] Update index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Marcos Cáceres --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index d6dd8507..c24e0fa6 100644 --- a/index.html +++ b/index.html @@ -2286,7 +2286,7 @@

    the requestShipping member is true. An empty list means no restriction, i.e. the user agent will return the full shipping address, subject to the - shipping redact list. This field has no effect if the + shipping redact list. The {{PaymentOptions/requestShippingAddressParts}} member has no effect if the {{PaymentOptions/requestShipping}} member is false. The payee can request additional pieces incrementally using {{PaymentRequestUpdateEvent}}'s {{PaymentRequestUpdateEvent/requestShippingAddress()}}. From 5e9016acd836091379e6911f65bb426cc7a0e1ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Mon, 16 Dec 2019 12:15:10 +1100 Subject: [PATCH 50/50] tidy --- index.html | 268 +++++++++++++++++++++++++++++------------------------ 1 file changed, 145 insertions(+), 123 deletions(-) diff --git a/index.html b/index.html index c24e0fa6..632c3d02 100644 --- a/index.html +++ b/index.html @@ -892,6 +892,7 @@

  • Set |request|.[[\requestedShippingAddressParts]] to |options|.{{PaymentOptions/requestShippingAddressParts}}. +
  • Set |request|.[[\state]] to "created".
  • Set |request|.[[\updating]] to false. @@ -1140,7 +1141,8 @@

    Pass the converted second element in the |paymentMethod| tuple, |modifiers|, - |request|.[[\options]].{{PaymentOptions/requestBillingAddress}} and + |request|.[[\options]].{{PaymentOptions/requestBillingAddress}} + and |request|.[[\options]].{{PaymentOptions/requestBillingAddressParts}}. Optionally, the user agent SHOULD send the appropriate data from |request| to the user-selected payment handler in order to @@ -1502,7 +1504,8 @@

    The current sequence<{{AddressParts}}> specifying the payee-requested shipping address parts, initially supplied to the constructor via {{PaymentOptions}}'s - {{PaymentOptions/requestShippingAddressParts}} and then updated with calls to + {{PaymentOptions/requestShippingAddressParts}} and then updated + with calls to {{PaymentRequestUpdateEvent/requestShippingAddress()}}. @@ -1744,8 +1747,8 @@

    the developer that the currency is invalid.

  • If |amount|.value is not a valid decimal monetary - value, throw a {{TypeError}}, optionally informing the - developer that the currency is invalid. + value, throw a {{TypeError}}, optionally informing the developer + that the currency is invalid.
  • Set |amount|.currency to the result of ASCII uppercase |amount|.currency. @@ -2198,30 +2201,31 @@

    and return the billing address associated with a payment method (e.g., the billing address associated with a credit card). The user agent returns the billing address as part of the - {{PaymentMethodChangeEvent}}'s {{PaymentMethodChangeEvent/methodDetails}} attribute and the - {{PaymentResponse}}'s {{PaymentResponse/details}} attribute. A payee can use this - information to, for example, calculate tax in certain jurisdictions - and update the displayed total. See below for privacy considerations - regarding [[[#user-info]]]. + {{PaymentMethodChangeEvent}}'s + {{PaymentMethodChangeEvent/methodDetails}} attribute and the + {{PaymentResponse}}'s {{PaymentResponse/details}} attribute. A payee + can use this information to, for example, calculate tax in certain + jurisdictions and update the displayed total. See below for privacy + considerations regarding [[[#user-info]]].
    requestBillingAddressParts member
    A sequence of {{AddressParts}} that specifies which fine-grained - parts of the billing address that the payee wishes to receive when the - requestBillingAddress member is true. An empty list means no - restriction, i.e. the payee requests the full billing address. The requestBillingAddressParts - member has no effect if the requestBillingAddress member is - false. + parts of the billing address that the payee wishes to receive when + the requestBillingAddress member is true. An empty list means + no restriction, i.e. the payee requests the full billing address. The + requestBillingAddressParts member has no effect if the + requestBillingAddress member is false. @@ -2261,19 +2265,18 @@

    and return a shipping address as part of the payment request (e.g., when physical goods need to be shipped by the payee to the user). The user agent returns the shipping address in the - {{PaymentRequest}}'s {{PaymentRequest/shippingAddress}} - attribute and the {{PaymentResponse}}'s - {{PaymentResponse/shippingAddress}} attribute. The former is subject - to a shipping redact list per the shipping address changed - algorithm. + {{PaymentRequest}}'s {{PaymentRequest/shippingAddress}} attribute and + the {{PaymentResponse}}'s {{PaymentResponse/shippingAddress}} + attribute. The former is subject to a shipping redact list per + the shipping address changed algorithm.

    @@ -2285,10 +2288,11 @@

    parts of the shipping address that the payee wishes to receive when the requestShipping member is true. An empty list means no restriction, i.e. the user agent will return the full shipping - address, subject to the - shipping redact list. The {{PaymentOptions/requestShippingAddressParts}} member has no effect if the - {{PaymentOptions/requestShipping}} member is false. The payee can request - additional pieces incrementally using {{PaymentRequestUpdateEvent}}'s + address, subject to the shipping redact list. The + {{PaymentOptions/requestShippingAddressParts}} member has no effect + if the {{PaymentOptions/requestShipping}} member is false. The payee + can request additional pieces incrementally using + {{PaymentRequestUpdateEvent}}'s {{PaymentRequestUpdateEvent/requestShippingAddress()}}.
    @@ -3006,9 +3010,9 @@

    1. -
    2. If |requestedParts| is empty, set it to « - "addressLine", "city", "country", "dependentLocality", "organization", - "phone", "postalCode", "recipient", "region", "sortingCode"». +
    3. If |requestedParts| is empty, set it to « "addressLine", "city", + "country", "dependentLocality", "organization", "phone", + "postalCode", "recipient", "region", "sortingCode"».
    4. Let |details:AddressInit| be an AddressInit dictionary with no members present. @@ -3028,8 +3032,8 @@

      was provided.

    5. If "phone" is in |requestedParts| and is not in |redactList|, set - |details|["phone"] to the user-provided phone number, or to the - empty string if none was provided. + |details|["phone"] to the user-provided phone number, or to + the empty string if none was provided.
    6. -
    7. If "postalCode" is in |requestedParts| and is not in |redactList|, - set |details|["postalCode"] to the user-provided postal code, - or to the empty string if none was provided. Optionally, redact part - of |details|["postalCode"]. +
    8. If "postalCode" is in |requestedParts| and is not in + |redactList|, set |details|["postalCode"] to the user-provided + postal code, or to the empty string if none was provided. Optionally, + redact part of |details|["postalCode"].

      Postal codes in certain countries can be so specific as @@ -3098,9 +3102,10 @@

    -
  • If "sortingCode" is in |requestedParts| and is not in |redactList|, - set |details|["sortingCode"] to the user-provided sorting code, - or to the empty string if none was provided. +
  • If "sortingCode" is in |requestedParts| and is not in + |redactList|, set |details|["sortingCode"] to the + user-provided sorting code, or to the empty string if none was + provided.
  • Internally construct a @@ -3714,9 +3719,9 @@

    [[\retryPromise]] - Null, or a {{Promise}} that resolves when a user accepts - the payment request or rejects if the user aborts the - payment request. + Null, or a {{Promise}} that resolves when a user accepts the + payment request or rejects if the user aborts the payment + request. @@ -4059,9 +4064,8 @@

  • - - Constructor - + Constructor

    The |type| and |eventInitDict|.

  • Set |event|.[[\waitForMethodDetails]] to false. +
  • Return |event|.
  • @@ -4100,19 +4105,19 @@

    - - requestBillingAddress() - method + requestBillingAddress() + method

    [[\waitForMethodDetails]] - A boolean indicating whether there is a pending request for - a method-specific details object initiated by + A boolean indicating whether there is a pending request for a + method-specific details object initiated by requestBillingAddress() that has not settled. @@ -4288,8 +4300,7 @@

    Constructor - + "PaymentRequestUpdateEvent.PaymentRequestUpdateEvent()">Constructor

    @@ -4305,22 +4316,23 @@

  • Set |event|.[[\waitForUpdate]] to false.
  • Set |event|.[[\waitForShippingAddress]] to false. +
  • Return |event|.
  • - - requestShippingAddress() - method + requestShippingAddress() + method

    - The requestShippingAddress(|addressParts|) method MUST act as - follows: + The requestShippingAddress(|addressParts|) method MUST act + as follows:

    1. Let |event:PaymentRequestUpdateEvent| be this {{PaymentRequestUpdateEvent}} instance.
    2. -
    3. If |event|'s {{ Event/type }} attribute is not - shippingaddresschange, then return a promise rejected with - a {{TypeError}}. +
    4. If |event|'s {{ Event/type }} attribute is not + shippingaddresschange, then return a promise rejected + with a {{TypeError}}. +
    5. Let |request:PaymentRequest| be the value of |event|'s [=Event/target=].
    6. @@ -4347,28 +4360,35 @@

    7. If any of the following is true, then return a promise rejected with an {{"InvalidStateError"}} {{DOMException}}:
    8. -
    9. Set |event|.[[\waitForShippingAddress]] to true.
    10. -
    11. Let |addressPromise:Promise| be a new promise.
    12. -
    13. Return |addressPromise|, and perform the remaining steps - in parallel. +
    14. Set |event|.[[\waitForShippingAddress]] to true. +
    15. +
    16. Let |addressPromise:Promise| be a new promise. +
    17. +
    18. Return |addressPromise|, and perform the remaining steps in + parallel.
    19. -
    20. Update |request|.[[\requestedShippingAddressParts]] to be - the union of itself and |addressParts|. +
    21. Update |request|.[[\requestedShippingAddressParts]] to + be the union of itself and |addressParts|.
    22. -
    23. Let |address:PaymentAddress| be the result of create - a `PaymentAddress` from user-provided input with shipping - redact list and |request|.[[\requestedShippingAddressParts]] - . +
    24. Let |address:PaymentAddress| be the result of create a + `PaymentAddress` from user-provided input with shipping + redact list and + |request|.[[\requestedShippingAddressParts]].
    25. Set |request|.[=PaymentRequest/shippingAddress=] to |address|.
    26. -
    27. Set |event|.[[\waitForShippingAddress]] to false.
    28. +
    29. Set |event|.[[\waitForShippingAddress]] to false. +
    30. Resolve |addressPromise| with |address|.
    @@ -4688,9 +4708,12 @@

    -

    Shipping redact list

    -

    The shipping redact list is a redact list that - includes « "organization", "phone", "recipient", "addressLine" ». +

    + Shipping redact list +

    +

    + The shipping redact list is a redact list that + includes « "organization", "phone", "recipient", "addressLine" ».

    @@ -5466,16 +5489,16 @@

    The validate merchant's details algorithm takes a - {{Promise}} |opaqueDataPromise| and a {{PaymentRequest}} - |request|. The steps are conditional on the |opaqueDataPromise| - settling. If |opaqueDataPromise| never settles then the payment - request is blocked. The user agent SHOULD provide the user with a - means to abort a payment request. Implementations MAY choose to - implement a timeout for pending updates if |opaqueDataPromise| - doesn't settle in a reasonable amount of time. If an implementation - chooses to implement a timeout, they MUST execute the steps listed - below in the "upon rejection" path. Such a timeout is a fatal error - for the payment request. + {{Promise}} |opaqueDataPromise| and a {{PaymentRequest}} |request|. + The steps are conditional on the |opaqueDataPromise| settling. If + |opaqueDataPromise| never settles then the payment request is + blocked. The user agent SHOULD provide the user with a means to abort + a payment request. Implementations MAY choose to implement a timeout + for pending updates if |opaqueDataPromise| doesn't settle in a + reasonable amount of time. If an implementation chooses to implement + a timeout, they MUST execute the steps listed below in the "upon + rejection" path. Such a timeout is a fatal error for the payment + request.

    1. Set |request|.[[\updating]] to true. @@ -5759,8 +5782,7 @@

      The terms internal - slot, - and , and JSON.stringify are defined by [[ECMASCRIPT]].

      @@ -5795,8 +5817,8 @@

      guard against running out of memory, or to work around platform-specific limitations. When an input exceeds implementation-specific limit, the user agent MUST throw, or, in the - context of a promise, reject with, a {{TypeError}} optionally - informing the developer of how a particular input exceeded an + context of a promise, reject with, a {{TypeError}} optionally informing + the developer of how a particular input exceeded an implementation-specific limit.