Re: [w3c/browser-payment-api] Define payment option filtering algorithm. (#420)

adamroach requested changes on this pull request.

Thanks! The text looks mostly good, but I think you cut a bit too deep. I'd also like to get on the same page about how to indicate filters in the PaymentRequest object.

> +        </h2>
+        <p>
+          The <dfn data-lt="filter payment options">filter payment options
+          algorithm</dfn> runs when user agent presents the user with the
+          collection of payment options available for selection. It MUST run the
+          following steps:
+        </p>
+        <ol>
+          <li>Let <var>matchingOptions</var> be an empty list.</li>
+          <li>Let <var>request</var> be the <a>PaymentRequest</a> object that
+          the user is interacting with.
+          <li>For each <var>requestMethod</var> in
+            <var>request</var>.<a>[[\serializedMethodData]]</a>:
+            <ol type="I">
+              <li>Let <var>filters</var> be <var>requestMethod.data</var>
+                members whose values are lists of strings.</li>

Hrm. I thought, after our last discussion on this point, we had reached agreement that this was problematic, in that it precluded payment methods from defining `data` parameters whose values were a list of strings, but which were *not* filters.

> +        </p>
+        <ol>
+          <li>Let <var>matchingOptions</var> be an empty list.</li>
+          <li>Let <var>request</var> be the <a>PaymentRequest</a> object that
+          the user is interacting with.
+          <li>For each <var>requestMethod</var> in
+            <var>request</var>.<a>[[\serializedMethodData]]</a>:
+            <ol type="I">
+              <li>Let <var>filters</var> be <var>requestMethod.data</var>
+                members whose values are lists of strings.</li>
+              <li>For each <var>option</var> of the installed
+                <a>payment apps</a>:
+                <ol type="i">
+                  <li>Let <var>optionMatch</var> be true.</li>
+                  <li>For <var>filterName</var> in the keys of
+                    <var>requestMethod</var>:

Shouldn't this be in the keys of `filters` rather than keys of `requestMethod`?

> @@ -628,30 +628,21 @@
           <li>Return <var>acceptPromise</var> and perform the remaining steps
           <a>in parallel</a>.
           </li>
-          <li>For each <var>paymentMethod</var> in

You're removing the part of the current document that deals with `paymentMethod` matching. The algorithm I thumbnailed in [issue 96](https://github.com/w3c/webpayments-payment-apps-api/issues/96) was intended to supplement `paymentMethod` matching rather than replace it. Basically, you need to put the *filter payments options algorithm* into a loop that evaluates it once for each `paymentMethod` in the request, and only those options that match the `paymentMethod` should be evaluated on each iteration.

-- 
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/browser-payment-api/pull/420#pullrequestreview-21843258

Received on Tuesday, 14 February 2017 19:47:26 UTC