Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validate PaymentCurrencyAmount.currency (closes #490) #567

Merged
merged 8 commits into from Aug 2, 2017
109 changes: 44 additions & 65 deletions index.html
Expand Up @@ -537,28 +537,23 @@ <h2>
</li>
<li data-link-for="PaymentDetailsInit">Process the total:
<ol>
<li>Let <var>total</var> be
<var>details</var>.<a>total</a>.<a data-lt=
"PaymentItem.amount">amount</a>.
</li>
<li data-tests=
"payment-request-ctor-currency-code-checks.https.html">
<a>Check and canonicalize <var>total</var></a>. Rethrow any
exceptions.
<a>Check and canonicalize total</a>
<var>details</var>.<a>total</a>.<a data-lt=
"PaymentItem.amount">amount</a>. Rethrow any exceptions.
</li>
</ol>
</li>
<li>If the <a>displayItems</a> member of <var>details</var> is
present, then for each <var>item</var> in
<var>details</var>.<a>displayItems</a>:
<ol>
<li>Let <var>amount</var> be <var>item</var>.<a data-lt=
"PaymentItem.amount">amount</a>.
</li>
<li data-tests=
"payment-request-ctor-currency-code-checks.https.html">
<a>Check and canonicalize <var>amount</var></a>. Rethrow any
exceptions.
<a>Check and canonicalize amount</a>
<var>item</var>.<a data-lt="PaymentItem.amount">amount</a>.
Rethrow any exceptions.
</li>
</ol>
</li>
Expand All @@ -580,13 +575,12 @@ <h2>
</li>
<li>For each <var>option</var> in <var>options</var>:
<ol>
<li>Let <var>amount</var> be
<var>item</var>.<a data-lt="PaymentItem.amount">amount</a>.
</li>
<li data-tests=
"payment-request-ctor-currency-code-checks.https.html">
<a>Check and canonicalize <var>amount</var></a>.
Rethrow any exceptions.
<a>Check and canonicalize amount</a>
<var>item</var>.<a data-lt=
"PaymentItem.amount">amount</a>. Rethrow any
exceptions.
</li>
<li>If <var>seenIDs</var> contains
<var>option</var>.<a>id</a>, then set <var>options</var>
Expand Down Expand Up @@ -635,13 +629,11 @@ <h2>
"PaymentDetailsModifier.total">total</a> member of <var>
modifier</var> is present, then:
<ol>
<li>Let <var>total</var> be
<var>modifier</var>.<a data-lt=
"PaymentDetailsModifier.total">total</a>.<a data-lt="PaymentItem.amount">amount</a>
</li>
<li data-tests=
"payment-request-ctor-currency-code-checks.https.html">
<a>Check and canonicalize <var>total</var></a>.
<a>Check and canonicalize total</a>
<var>modifier</var>.<a data-lt=
"PaymentDetailsModifier.total">total</a>.<a data-lt="PaymentItem.amount">amount</a>.
Rethrow any exceptions.
</li>
</ol>
Expand All @@ -652,14 +644,12 @@ <h2>
<var>item</var> of <var>modifier</var>.<a data-lt=
"PaymentDetailsModifier.additionalDisplayItems">additionalDisplayItems</a>:
<ol>
<li>Let <var>amount</var> be
<var>item</var>.<a data-lt=
"PaymentItem.amount">amount</a>.
</li>
<li data-tests=
"payment-request-ctor-currency-code-checks.https.html">
<a>Check and canonicalize <var>amount</var></a>.
Rethrow any exceptions.
<a>Check and canonicalize amount</a>
<var>item</var>.<a data-lt=
"PaymentItem.amount">amount</a>. Rethrow any
exceptions.
</li>
</ol>
</li>
Expand Down Expand Up @@ -1262,7 +1252,7 @@ <h2>
<dd>
A URL that indicates the currency system that the <a>currency</a>
identifier belongs to. By default, the value is
<code>urn:iso:std:iso:4217</code> indicating that <a>currency</a>
"<code>urn:iso:std:iso:4217</code>" indicating that <a>currency</a>
is defined by [[!ISO4217]] (for example, <code>USD</code> for US
Dollars).
</dd>
Expand Down Expand Up @@ -1370,7 +1360,7 @@ <h3>
<code>urn:iso:std:iso:4217</code>, terminate this algorithm.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing quotes here

</li>
<li>
<a>Check and canonicalize <var>amount</var></a>. Rethrow any
<a>Check and canonicalize amount</a> <var>amount</var>. Rethrow any
exceptions.
</li>
<li>If the first <a>code point</a> of <var>value</var> is U+002D (-),
Expand Down Expand Up @@ -2395,28 +2385,25 @@ <h2>
<li data-link-for="PaymentDetailsUpdate">If the
<a>total</a> member of <var>details</var> is present, then:
<ol>
<li>Let <var>total</var> be
<var>details</var>.<a>total</a>.<a data-lt=
"PaymentItem.amount">amount</a>.
</li>
<li>
<a>Check and canonicalize <var>total</var></a>. If an
exception is thrown, then <a>abort the update</a>
with that exception.
<a>Check and canonicalize total</a>
<var>details</var>.<a>total</a>.<a data-lt=
"PaymentItem.amount">amount</a>. If an exception is
thrown, then <a>abort the update</a> with that
exception.
</li>
</ol>
</li>
<li>If the <a>displayItems</a> member of <var>details</var>
is present, then for each <var>item</var> in
<var>details</var>.<a>displayItems</a>:
<ol>
<li>Let <var>amount</var> be
<var>item</var>.<a data-lt="PaymentItem.amount">amount</a>.
</li>
<li>
<a>Check and canonicalize <var>amount</var></a>. If
an exception is thrown, then <a>abort the update</a>
with that exception.
<a>Check and canonicalize amount</a>
<var>item</var>.<a data-lt=
"PaymentItem.amount">amount</a>. If an exception is
thrown, then <a>abort the update</a> with that
exception.
</li>
</ol>
</li>
Expand All @@ -2434,14 +2421,12 @@ <h2>
<li>For each <var>option</var> in
<var>shippingOptions</var>:
<ol>
<li>Let <var>amount</var> be
<var>option</var>.<a data-lt=
"PaymentShippingOption.amount">amount</a>.
</li>
<li>
<a>Check and canonicalize <var>amount</var></a>.
If an exception is thrown, then <a>abort the
update</a> with that exception.
<a>Check and canonicalize amount</a>
<var>option</var>.<a data-lt=
"PaymentShippingOption.amount">amount</a>. If an
exception is thrown, then <a>abort the update</a>
with that exception.
</li>
<li>If <var>seenIDs</var> contains
<var>option</var>.<a data-lt=
Expand Down Expand Up @@ -2483,15 +2468,12 @@ <h2>
<li>If the <a>total</a> member of
<var>modifier</var> is present, then:
<ol>
<li>Let <var>total</var> be
<var>modifier</var>.<a>total</a>.<a data-lt=
"PaymentItem.amount">amount</a>.
</li>
<li>
<a>Check and canonicalize
<var>total</var></a>. If an exception is
thrown, then <a>abort the update</a> with
that exception.
<a>Check and canonicalize total</a>
<var>modifier</var>.<a>total</a>.<a data-lt=
"PaymentItem.amount">amount</a>. If an
exception is thrown, then <a>abort the
update</a> with that exception.
</li>
</ol>
</li>
Expand All @@ -2500,15 +2482,12 @@ <h2>
<a>PaymentItem</a> <var>item</var> in
<var>modifier</var>.<a>additionalDisplayItems</a>:
<ol>
<li>Let <var>amount</var> be
<var>item</var>.<a data-lt=
"PaymentItem.amount">amount</a>.
</li>
<li>
<a>Check and canonicalize
<var>amount</var></a>. If an exception is
thrown, then <a>abort the update</a> with
that exception.
<a>Check and canonicalize amount</a>
<var>item</var>.<a data-lt=
"PaymentItem.amount">amount</a>. If an
exception is thrown, then <a>abort the
update</a> with that exception.
</li>
</ol>
</li>
Expand Down