Skip to content

Commit bf98afb

Browse files
Change what canMakePayment() means (#806)
* Change what canMakePayment() means During the F2F, we came to a consensus that "canMakePayment" means "the user agent supports the PMIs" - but it does not mean that there is a payment instrument set up. We concluded that we might add something to check if there is an active instrument in the future. * Link abuse protection tests
1 parent ff9830d commit bf98afb

File tree

1 file changed

+10
-34
lines changed

1 file changed

+10
-34
lines changed

index.html

Lines changed: 10 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,9 @@ <h2>
12021202
then return <a>a promise rejected with</a> an
12031203
"<a>InvalidStateError</a>" <a>DOMException</a>.
12041204
</li>
1205-
<li>Optionally, at the <a>user agent</a>'s discretion, return <a>a
1205+
<li data-tests=
1206+
"payment-request/payment-request-canmakepayment-method-protection.https.html">
1207+
Optionally, at the <a>user agent</a>'s discretion, return <a>a
12061208
promise rejected with</a> a "<a>NotAllowedError</a>"
12071209
<a>DOMException</a>.
12081210
<p class="note" data-link-for="PaymentRequest">
@@ -1216,51 +1218,25 @@ <h2>
12161218
time period in which those calls were made.
12171219
</p>
12181220
</li>
1219-
<li>Let <var>promise</var> be <a>a new promise</a>.
1221+
<li>Let <var>hasHandlerPromise</var> be <a>a new promise</a>.
12201222
</li>
1221-
<li>Return <var>promise</var>, and perform the remaining steps <a>in
1222-
parallel</a>.
1223+
<li>Return <var>hasHandlerPromise</var>, and perform the remaining
1224+
steps <a>in parallel</a>.
12231225
</li>
12241226
<li>For each <var>paymentMethod</var> tuple in
12251227
<var>request</var>.<a>[[\serializedMethodData]]</a>:
12261228
<ol>
12271229
<li>Let <var>identifier</var> be the first element in the
12281230
<var>paymentMethod</var> tuple.
12291231
</li>
1230-
<li>Let <var>data</var> be the result of <a data-cite=
1231-
"ECMASCRIPT#sec-json.parse">JSON-parsing</a> the second element
1232-
in the <var>paymentMethod</var> tuple.
1233-
</li>
1234-
<li>If required by the specification that defines the
1235-
<var>identifier</var>, then <a data-cite=
1236-
"WEBIDL#dfn-convert-ecmascript-to-idl-value">convert</a>
1237-
<var>data</var> to an IDL value. Otherwise, <a data-cite=
1238-
"WEBIDL#dfn-convert-ecmascript-to-idl-value">convert</a> to
1239-
<a data-cite="WEBIDL#idl-object">object</a>.
1240-
</li>
1241-
<li>If conversion results in an <a data-cite=
1242-
"WEBIDL#dfn-exception">exception</a> <var>error</var>, reject
1243-
<var>promise</var> with <var>error</var> and terminate this
1232+
<li>If there user agent has a <a>payment handler</a> that support
1233+
handling payment requests for <var>identifier</var>, resolve
1234+
<var>hasHandlerPromise</var> with true and terminate this
12441235
algorithm.
12451236
</li>
1246-
<li>Let <var>handlers</var> be a <a>list</a> of registered
1247-
<a>payment handlers</a> that are authorized and can handle
1248-
payment request for <var>identifier</var>.
1249-
</li>
1250-
<li>For each <var>handler</var> in <var>handlers</var>:
1251-
<ol>
1252-
<li>Let <var>canMakePayment</var> be the result of running
1253-
<var>handler</var>'s <a>steps to check if a payment can be
1254-
made</a> with <var>data</var>.
1255-
</li>
1256-
<li>If <var>canMakePayment</var> is true, resolve
1257-
<var>promise</var> with true, and return.
1258-
</li>
1259-
</ol>
1260-
</li>
12611237
</ol>
12621238
</li>
1263-
<li>Resolve <var>promise</var> with false.
1239+
<li>Resolve <var>hasHandlerPromise</var> with false.
12641240
</li>
12651241
</ol>
12661242
</section>

0 commit comments

Comments
 (0)