Set |request|.[[\updating]] to false.
@@ -1131,12 +1134,15 @@
Pass the [=converted to an IDL value|converted=] second element
- in the |paymentMethod| tuple and |modifiers|. 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 various attributes
- and other internal slots of |request| (some MAY be excluded for
- privacy reasons where appropriate).
+ the |paymentMethod| tuple, |modifiers|,
+ |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
+ guide the user through the payment process. This includes the
+ various attributes and other internal slots of |request| (some
+ MAY be excluded for privacy reasons where appropriate).
Handling of multiple applicable modifiers in the
@@ -1486,6 +1492,19 @@
+ 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
+ {{PaymentRequestUpdateEvent/requestShippingAddress()}}.
+
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
+ 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 exposing user
- information.
+ 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.
+
requestPayerName member
@@ -2118,10 +2247,38 @@
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 {{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.
+
+
+
+ requestShippingAddressParts member
+
+
+ A sequence of {{AddressParts}} that specifies which fine-grained
+ 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
+ {{PaymentRequestUpdateEvent/requestShippingAddress()}}.
- Represents the country of the address. When getting, returns
- the value of the {{PaymentAddress}}'s [[\country]] internal
- slot.
-
-
addressLine attribute
@@ -2414,21 +2561,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.
@@ -2444,32 +2591,32 @@
- postalCode attribute
+ organization attribute
-
- Represents the postal code of the address. When getting,
+
- 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.
@@ -2484,12 +2631,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.
Creating a `PaymentAddress` from user-provided input
- The steps to create a `PaymentAddress` from
- user-provided input are given by the following algorithm. The
- algorithm takes a list |redactList|.
+ 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|.
@@ -2837,26 +2995,30 @@
+
If |requestedParts| is empty, set it to « "addressLine", "city",
+ "country", "dependentLocality", "organization", "phone",
+ "postalCode", "recipient", "region", "sortingCode"».
+
Let |details:AddressInit| be an AddressInit dictionary
with no members present.
-
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.
+
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.
-
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.
+
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.
-
If "phone" is not in |redactList|, set |details|["phone"]
- to the user-provided phone number, or to the empty string if none was
- provided.
+
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.
-
If "city" is not in |redactList|, set |details|["city"] to
- the user-provided city, or to the empty string if none was provided.
+
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.
-
If "dependentLocality" is not in |redactList|, set
- |details|["dependentLocality"] to the user-provided dependent
- locality, or to the empty string if none was provided.
+
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.
-
If "organization" is not in |redactList|, set
- |details|["organization"] to the user-provided recipient
- organization, or to the empty string if none was provided.
+
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.
-
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"].
+
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
@@ -2895,13 +3060,13 @@
-
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.
+
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.
- If "region" is not in |redactList|:
+ If "region" is in |requestedParts| and is not in |redactList|:
@@ -2922,9 +3087,10 @@
-
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 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.
[=PaymentAddress.PaymentAddress()|Internally construct a new
`PaymentAddress`=] with |details| and return the result.
@@ -3857,8 +4023,30 @@
Let |event:PaymentMethodChangeEvent| be the result of calling
+ the [=Event/constructor=] of {{PaymentMethodChangeEvent}} with
+ |type| and |eventInitDict|.
+
Let |methodDetailsPromise:Promise| be a new promise.
+
+
Return |methodDetailsPromise|, and perform the remaining steps
+ in parallel.
+
+
Let |handler| be the payment handler that triggered this
+ |event|.
+
+
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.
+
Resolve |methodDetailsPromise| with |methodDetails|.
+
+
+
@@ -3906,6 +4214,35 @@
+
+
+ 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.
+
- 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.
-
-
-
-
Let |redactList:list| be the empty list. Set |redactList| to
- « "organization", "phone", "recipient", "addressLine" ».
-