Re: [w3c/payment-method-basic-card] WIP: Last wins (#71)

danyao commented on this pull request.



> +              </li>
+              <li>If <var>object</var> is <code>null</code>, continue.
+              </li>
+              <li>Set <var>restrictions</var> to the result of <a data-cite=
+              "webidl#dfn-convert-ecmascript-to-idl-value">converting</a> <var>
+                object</var> into a <a>BasicCardRequest</a>.
+              </li>
+              <li>Apply <var>restrictions</var>'s <a>supportedNetworks</a>
+              member to constrain the card type inputs of the payment UI.
+              </li>
+              <li>Break.
+              </li>
+            </ol>
+          </li>
+          <li>If an payment instrument is selected by default, <a>apply the
+          modifiers</a> using <var>request</var><a data-cite=

```suggestion
          modifiers</a> using <var>request</var>.<a data-cite=
```

> +          </pre>
+        </div>
+        <ol class="algorithm">
+          <li>For each <a data-cite="infra#pair">pair</a> (<a>DOMString</a>
+          <var>id</var> / string <var>data</var>) of
+          <var>request</var>.<a data-cite=
+          "payment-request/#dfn-serializedmethoddata">[[\serializedMethodData]]</a>
+          in reverse order:
+            <ol>
+              <li>If <var>id</var> is not "<a>basic-card</a>", continue.
+              </li>
+              <li>Let <var data-type="object">object</var> be result of
+              <a data-cite="ecma-262#sec-json.parse">JSON-parsing</a>
+              <var>data</var>.
+              </li>
+              <li>If <var>object</var> is <code>null</code>, continue.

Can `object` also be `null` if the original `PaymentMethodData` didn't contain a `data` field? Should the absence of `data` field also be considered "all networks are supported"?

> +              <li>If <var>id</var> is not "<a>basic-card</a>", continue.
+              </li>
+              <li>Let <var>object</var> be result of <a data-cite=
+              "ecma-262#sec-json.parse">JSON-parsing</a> <var>data</var>.
+              </li>
+              <li>If <var>object</var> is <code>null</code>, continue.
+              </li>
+              <li>Let <var>bcRequest</var> be the result of converting
+              <var>object</var> to <a>BasicCardRequest</a>.
+              </li>
+              <li>If <var>bcRequest</var>'s <a>supportedNetworks</a> is zero
+              length, or <a>supportedNetworks</a> includes
+              <var>networkIdentifier</var>:
+                <ol>
+                  <li>Let <var>modifier</var> be the PaymentMethodModifier from
+                  <var>request</var>.[[\details].modifiers at <var>index</var>.

```suggestion
                  <var>request</var>.[[details]].modifiers at <var>index</var>.
```

-- 
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-method-basic-card/pull/71#pullrequestreview-216223200

Received on Tuesday, 19 March 2019 15:31:27 UTC