@@ -1202,7 +1202,9 @@ <h2>
1202
1202
then return < a > a promise rejected with</ a > an
1203
1203
"< a > InvalidStateError</ a > " < a > DOMException</ a > .
1204
1204
</ 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
1206
1208
promise rejected with</ a > a "< a > NotAllowedError</ a > "
1207
1209
< a > DOMException</ a > .
1208
1210
< p class ="note " data-link-for ="PaymentRequest ">
@@ -1216,51 +1218,25 @@ <h2>
1216
1218
time period in which those calls were made.
1217
1219
</ p >
1218
1220
</ 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 > .
1220
1222
</ 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 > .
1223
1225
</ li >
1224
1226
< li > For each < var > paymentMethod</ var > tuple in
1225
1227
< var > request</ var > .< a > [[\serializedMethodData]]</ a > :
1226
1228
< ol >
1227
1229
< li > Let < var > identifier</ var > be the first element in the
1228
1230
< var > paymentMethod</ var > tuple.
1229
1231
</ 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
1244
1235
algorithm.
1245
1236
</ 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 >
1261
1237
</ ol >
1262
1238
</ li >
1263
- < li > Resolve < var > promise </ var > with false.
1239
+ < li > Resolve < var > hasHandlerPromise </ var > with false.
1264
1240
</ li >
1265
1241
</ ol >
1266
1242
</ section >
0 commit comments