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 @@

12021202
then return <a>a promise rejected witha> an
12031203
"<a>InvalidStateErrora>" <a>DOMExceptiona>.
12041204
li>
1205-
<li>Optionally, at the <a>user agenta>'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 agenta>'s discretion, return <a>a
12061208
promise rejected witha> a "<a>NotAllowedErrora>"
12071209
<a>DOMExceptiona>.
12081210
<p class="note" data-link-for="PaymentRequest">
@@ -1216,51 +1218,25 @@

12161218
time period in which those calls were made.
12171219
p>
12181220
li>
1219-
<li>Let <var>promisevar> be <a>a new promisea>.
1221+
<li>Let <var>hasHandlerPromisevar> be <a>a new promisea>.
12201222
li>
1221-
<li>Return <var>promisevar>, and perform the remaining steps <a>in
1222-
parallela>.
1223+
<li>Return <var>hasHandlerPromisevar>, and perform the remaining
1224+
steps <a>in parallela>.
12231225
li>
12241226
<li>For each <var>paymentMethodvar> tuple in
12251227
<var>requestvar>.<a>[[\serializedMethodData]]a>:
12261228
<ol>
12271229
<li>Let <var>identifiervar> be the first element in the
12281230
<var>paymentMethodvar> tuple.
12291231
li>
1230-
<li>Let <var>datavar> be the result of <a data-cite=
1231-
"ECMASCRIPT#sec-json.parse">JSON-parsinga> the second element
1232-
in the <var>paymentMethodvar> tuple.
1233-
li>
1234-
<li>If required by the specification that defines the
1235-
<var>identifiervar>, then <a data-cite=
1236-
"WEBIDL#dfn-convert-ecmascript-to-idl-value">converta>
1237-
<var>datavar> to an IDL value. Otherwise, <a data-cite=
1238-
"WEBIDL#dfn-convert-ecmascript-to-idl-value">converta> to
1239-
<a data-cite="WEBIDL#idl-object">objecta>.
1240-
li>
1241-
<li>If conversion results in an <a data-cite=
1242-
"WEBIDL#dfn-exception">exceptiona> <var>errorvar>, reject
1243-
<var>promisevar> with <var>errorvar> and terminate this
1232+
<li>If there user agent has a <a>payment handlera> that support
1233+
handling payment requests for <var>identifiervar>, resolve
1234+
<var>hasHandlerPromisevar> with true and terminate this
12441235
algorithm.
12451236
li>
1246-
<li>Let <var>handlersvar> be a <a>lista> of registered
1247-
<a>payment handlersa> that are authorized and can handle
1248-
payment request for <var>identifiervar>.
1249-
li>
1250-
<li>For each <var>handlervar> in <var>handlersvar>:
1251-
<ol>
1252-
<li>Let <var>canMakePaymentvar> be the result of running
1253-
<var>handlervar>'s <a>steps to check if a payment can be
1254-
madea> with <var>datavar>.
1255-
li>
1256-
<li>If <var>canMakePaymentvar> is true, resolve
1257-
<var>promisevar> with true, and return.
1258-
li>
1259-
ol>
1260-
li>
12611237
ol>
12621238
li>
1263-
<li>Resolve <var>promisevar> with false.
1239+
<li>Resolve <var>hasHandlerPromisevar> with false.
12641240
li>
12651241
ol>
12661242
section>

0 commit comments

Comments
 (0)