Skip to content

Commit

Permalink
Throw on dup shippingOptions (closes #594, ##595)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoscaceres committed Aug 25, 2017
1 parent 63c479a commit 24e164d
Showing 1 changed file with 20 additions and 26 deletions.
46 changes: 20 additions & 26 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -635,10 +635,12 @@ <h2>
exceptions.
</li>
<li>If <var>seenIDs</var> contains
<var>option</var>.<a>id</a>, then set <var>options</var>
to an empty sequence and break.
<var>option</var>.<a>id</a>, then throw a
"<a>ConstraintError</a>" <a>DOMException</a>. Optionally,
inform the developer that shipping option IDs must be
unique.
</li>
<li>Append <var>option</var>.<a>id</a> to
<li>Otherwise, append <var>option</var>.<a>id</a> to
<var>seenIDs</var>.
</li>
</ol>
Expand Down Expand Up @@ -1500,11 +1502,6 @@ <h2>
<dd>
A sequence containing the different shipping options for the user
to choose from.
<p>
If the sequence is empty, then this indicates that the merchant
cannot ship to the current <a data-lt=
"PaymentRequest.shippingAddress">shippingAddress</a>.
</p>
<p>
If an item in the sequence has the <a data-lt=
"PaymentShippingOption.selected">selected</a> member set to true,
Expand Down Expand Up @@ -2544,12 +2541,13 @@ <h2>
</li>
<li>If <var>seenIDs</var> contains
<var>option</var>.<a data-lt=
"PaymentShippingOption.id">id</a>, then set
<var>options</var> to an empty sequence and break.
"PaymentShippingOption.id">id</a>, then <a>abort
the update</a> with a "ConstraintError"
DOMException.
</li>
<li>Append <var>option</var>.<a data-lt=
"PaymentShippingOption.id">id</a> to
<var>seenIDs</var>.
<li>Otherwise, append
<var>option</var>.<a data-lt="PaymentShippingOption.id">id</a>
to <var>seenIDs</var>.
</li>
</ol>
</li>
Expand Down Expand Up @@ -2681,20 +2679,14 @@ <h2>
</li>
<li>If <var>request</var>.<a>[[\options]]</a>.<a data-lt=
"PaymentOptions.requestShipping">requestShipping</a> is
true, and
<var>request</var>.<a>[[\details]]</a>.<a>shippingOptions</a>
is empty, then the developer has signified that there are
no valid shipping options for the currently-chosen shipping
address (given by <var>request</var>'s <a data-lt=
"PaymentRequest.shippingAddress">shippingAddress</a>). In
this case, the user agent SHOULD display an error
indicating this, and MAY indicate that the currently-chosen
shipping address is invalid in some way. The user agent
SHOULD use the <a data-lt=
true, and the <a data-lt=
"PaymentDetailsUpdate.error">error</a> is present, the user
agent SHOULD request that the user selected an alternative
shipping address, or be given the option abort the payment
request. The user agent SHOULD display the <a data-lt=
"PaymentDetailsUpdate.error">error</a> member of
<var>details</var>, if it is present, to give more
information about why there are no valid shipping options
for that address.
<var>details</var> to give more information about why the
address can't be used to complete the transaction.
</li>
</ol>
</li>
Expand Down Expand Up @@ -3206,6 +3198,8 @@ <h2>
"<code><dfn data-cite=
"!WEBIDL#aborterror">AbortError</dfn></code>",
"<code><dfn data-cite=
"!WEBIDL#constrainterror">ConstraintError</dfn></code>",
"<code><dfn data-cite=
"!WEBIDL#invalidstateerror">InvalidStateError</dfn></code>",
"<code><dfn data-cite=
"!WEBIDL#notallowederror">NotAllowedError</dfn></code>",
Expand Down

0 comments on commit 24e164d

Please sign in to comment.