Detailed shipping address contains sensitive user information.
- Developers are encouraged to use requestShippingAddress()
+ Developers are encouraged to use {{requestShippingAddress()}}
to incrementally request pieces they require instead of asking for
- all up front using the PaymentOptions.requestShipping
+ all up front using the {{PaymentOptions.requestShipping}}
boolean. For example, if flat-rate shipping is available in
country A but only variable per-region shipping is available in
country B, a developer should request only "country" first and
@@ -4084,16 +4097,16 @@
A future version of this specification may remove the all-in-one
- PaymentOptions.requestShipping boolean.
+ {{PaymentOptions.requestShipping}} boolean.
- A developer can call requestShippingAddress() repeatedly.
- Each call returns a promise that resolves to a PaymentAddress
- with all previously requested address fields populated.
+ A developer can call {{requestShippingAddress()}} repeatedly.
+ Each call returns a promise that resolves to a {{PaymentAddress}}
+ with all previously requested address fields populated.
If a requested address part is also in the redact list of shipping
- address, then the returned PaymentAddress will not have the
+ address, then the returned {{PaymentAddress}} will not have the
corresponding field populated.
{{PaymentRequestUpdateEvent}} instance.
If |event|'s {{ Event.isTrusted }} attribute is false, then
- [=exception/throw=] an {{"InvalidStateError"}} {{DOMException}}.
+ return a promise rejected with an {{"InvalidStateError"}}
+ {{DOMException}}.
If |event|'s [=Event/target=] is an instance of
PaymentResponse , let |request:PaymentRequest| be |event|'s
@@ -4130,21 +4144,24 @@
Assert: |request| is an instance of {{PaymentRequest}}.
If |request|.[[\state]] is not "interactive ",
- then [=exception/throw=] an {{"InvalidStateError"}}
+ then return a promise rejected with an {{"InvalidStateError"}}
{{DOMException}}.
- Let |shippingAddress| be the value of |request|'s
- shippingAddress
- attribute.
+ Let |shippingAddressPromise:Promise| be a new promise .
+ Return |shippingAddressPromise|, and perform the remaining steps in
+ parallel .
+
+ Let |shippingAddress:PaymentAddress| be |request|'s
+ [=PaymentRequest/shippingAddress=].
- Let |details| be an AddressInit dictionary with no
- members present.
+ Let |details:AddressInit| be an {{AddressInit}} dictionary with
+ no members present.
- For each attribute |attributeName| in |shippingAddress|
+ For each attribute |attributeName| in |shippingAddress:PaymentAddress|:
Set |details|[|attributeName|] to the value of
|shippingAddress|.[[|attributeName|]] if it is not empty.
@@ -4152,18 +4169,18 @@
Let |redactList| be the empty list. Set |redactList| to
- « "organization", "phone", "recipient", "addressLine" ».
+ « "organization", "phone", "recipient", "addressLine" ».
For each |addressPart| in |addressParts|:
- If |details|[|addresPart|] is already present, continue.
- If |addressPart| is not in |redactList|, set |details|[|addressPart|]
- to the user provided value for this addres part.
-
+ If |details|[|addresPart|] is already present, continue.
+ If |addressPart| is in |redactList|, continue.
+ Set |details|[|addressPart|] to the user provided value.
Internally construct
- a new PaymentAddress with |details| and return the result.
+ a new PaymentAddress with |details| and resolve
+ |shippingAddressPromise| with the result.