Skip to content

Commit

Permalink
remove currencySystem member (#694)
Browse files Browse the repository at this point in the history
* Remove `currencySystem` member
* Editorial: add note about digital currencies
  • Loading branch information
marcoscaceres committed May 1, 2018
1 parent dbcbe9e commit 6b2aebc
Showing 1 changed file with 43 additions and 50 deletions.
93 changes: 43 additions & 50 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,6 @@ <h2>
before proceeding along the W3C Recommendation track.
</p>
<ul>
<li>
<a data-lt=
"PaymentCurrencyAmount.currencySystem">currencySystem</a> (see
<a href="https://github.com/w3c/payment-request/issues/617">issue
617</a>).
</li>
<li data-link-for="PaymentItem">
<a>PaymentItem</a>'s <a>type</a> member and the
<a>PaymentItemType</a> enum (see <a href=
Expand Down Expand Up @@ -1407,56 +1401,63 @@ <h2>
dictionary PaymentCurrencyAmount {
required DOMString currency;
required DOMString value;
// Note: currencySystem is "at risk" of being removed!
DOMString currencySystem = "urn:iso:std:iso:4217";
};
</pre>
<p>
A <a>PaymentCurrencyAmount</a> dictionary is used to supply monetary
amounts.
</p>
<div class="issue atrisk">
<p>
This feature has been marked "<a>at risk</a>". If you'd like for this
feature to remain in the specification, please describe your use case
in <a href="https://github.com/w3c/payment-request/issues/490">issue
490</a>.
</p>
<dl>
<dt>
<dfn>currencySystem</dfn> member
</dt>
<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>
is defined by [[!ISO4217]] (for example, <code>USD</code> for US
Dollars).
</dd>
</dl>
</div>
<dl>
<dt>
<dfn>currency</dfn> member
</dt>
<dd>
<p>
A string containing a currency identifier. The value of
<a>currency</a> can be any string that is valid within the currency
system indicated by <a>currencySystem</a>.
</p>
<p>
When using [[!ISO4217]], all <a data-cite=
A [[!ISO4217]] <a data-cite=
"!ecma-402#sec-iswellformedcurrencycode">well-formed</a> 3-letter
alphabetic codes are allowed (i.e., the numeric codes are not
supported). Their canonical form is upper case. However, the set of
combinations of currency code for which localized currency symbols
are available is implementation dependent. Where a localized
currency symbol is not available, a user agent SHOULD use U+00A4
(¤) for formatting. User agents MAY format the display of the
<a>currency</a> member to adhere to OS conventions (e.g., for
localization purposes).
alphabetic code (i.e., the numeric codes are not supported). Their
canonical form is upper case. However, the set of combinations of
currency code for which localized currency symbols are available is
implementation dependent. Where a localized currency symbol is not
available, a user agent SHOULD use U+00A4 (¤) for formatting. User
agents MAY format the display of the <a>currency</a> member to
adhere to OS conventions (e.g., for localization purposes).
</p>
<div class="note" title=
"Digital currencies and ISO 4217 currency codes">
<p>
User agents implementing this specification enforce [[ISO4217]]'s
3-letter codes format via ECMAScript’s <a data-cite=
"!ecma-402#sec-iswellformedcurrencycode">isWellFormedCurrencyCode</a>
abstract operation, which is invoked as part of the <a>check and
canonicalize amount</a> algorithm. When a code does not adhere to
the [[ISO4217]] defined format, a <a>RangeError</a> is thrown.
</p>
<p>
Current implementations will therefore allow the use of
well-formed currency codes that are not part of the official
[[ISO4217]] list (e.g., XBT, XRP, etc.). If the provided code is
a currency that the browser knows how to display, then an
implementation will generally display the appropriate currency
symbol in the user interface (e.g., "USD" is shown as "$", "GBP"
is "£", and the non-standard "XBT" could be shown as "Ƀ"). When a
code cannot be matched, the specification recommends browsers
show a scarab "¤".
</p>
<p>
Efforts are underway at ISO to account for digital currencies,
which may result in an update to the [[ISO4217]] registry or an
entirely new registry. The community expects this will resolve
ambiguities that have crept in through the use of non-standard
3-letter codes; for example, does "BTC" refer to Bitcoin or to a
future Bhutan currency? At the time of publication, it remains
unclear what form this evolution will take, or even the time
frame in which the work will be completed. The W3C Web Payments
Working Group is liaising with ISO so that, in the future,
revisions to this specification remain compatible with relevant
ISO registries.
</p>
</div>
</dd>
<dt>
<dfn>value</dfn> member
Expand Down Expand Up @@ -1506,11 +1507,6 @@ <h3>
steps:
</p>
<ol data-link-for="PaymentCurrencyAmount">
<li data-tests=
"PaymentCurrencyAmount/currencySystem-member.https.html">If
<var>amount</var>.<a>currencySystem</a> is not
"<code>urn:iso:std:iso:4217</code>", throw a <a>TypeError</a>.
</li>
<li>Let <var>isValidCurrency</var> be the result of calling
<a data-cite=
"!ecma-402#sec-iswellformedcurrencycode">IsWellFormedCurrencyCode</a>
Expand All @@ -1536,9 +1532,6 @@ <h3>
steps:
</p>
<ol data-link-for="PaymentCurrencyAmount">
<li>If <var>total</var>.<a>currencySystem</a> is not
"<code>urn:iso:std:iso:4217</code>", terminate this algorithm.
</li>
<li>
<a>Check and canonicalize amount</a> <var>amount</var>. Rethrow any
exceptions.
Expand Down

0 comments on commit 6b2aebc

Please sign in to comment.