Re: [w3c/payment-request] Add regionCode attribute (#690)

domenic approved this pull request.

Nits with variable naming, but overall makes sense...

> @@ -2199,6 +2201,83 @@ <h2>
                 </li>
               </ol>
             </li>
+            <li>If <var>details</var>["<a>regionCode</a>"] is present and not
+            the empty string:
+              <ol>
+                <li>Let <var>regionPart</var> be the result of <a>strip leading

The variable naming here is super-confusing. To a web developer, a regionCode is something like "CA", right? But in this algorithm, `details["regionCode"]` is "CA", `regionPart` is "CA", and `regionCode` is "USA-CA".

I think the variable on this line should be _regionCode_, and on line 2213 should be _putativeCountrySubdivisionCodeElement_ or similar.

> @@ -2199,6 +2201,83 @@ <h2>
                 </li>
               </ol>
             </li>
+            <li>If <var>details</var>["<a>regionCode</a>"] is present and not
+            the empty string:
+              <ol>
+                <li>Let <var>regionPart</var> be the result of <a>strip leading
+                and trailing ASCII whitespace</a> from
+                <var>details</var>["<a>regionCode</a>"] and then
+                  <a data-cite="!INFRA#ascii-uppercase">ASCII uppercasing</a>
+                  the result.
+                </li>
+                <li>Let <var>regionCode</var> be the concatenation of
+                <var>address</var>.<a>[[\country]]</a>, a single U+002D (-) <a>
+                  code point</a>, <var>regionPart</var>.

Missing "and" after last comma.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/payment-request/pull/690#pullrequestreview-120036231

Received on Monday, 14 May 2018 22:52:44 UTC