|
1202 | 1202 | then return <a>a promise rejected witha> an
|
1203 | 1203 | "<a>InvalidStateErrora>" <a>DOMExceptiona>.
|
1204 | 1204 | 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 |
1206 | 1208 | promise rejected witha> a "<a>NotAllowedErrora>"
|
1207 | 1209 | <a>DOMExceptiona>.
|
1208 | 1210 | <p class="note" data-link-for="PaymentRequest">
|
|
1216 | 1218 | time period in which those calls were made.
|
1217 | 1219 | p>
|
1218 | 1220 | li>
|
1219 |
| - <li>Let <var>promisevar> be <a>a new promisea>. |
| 1221 | + <li>Let <var>hasHandlerPromisevar> be <a>a new promisea>. |
1220 | 1222 | 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>. |
1223 | 1225 | li>
|
1224 | 1226 | <li>For each <var>paymentMethodvar> tuple in
|
1225 | 1227 | <var>requestvar>.<a>[[\serializedMethodData]]a>:
|
1226 | 1228 | <ol>
|
1227 | 1229 | <li>Let <var>identifiervar> be the first element in the
|
1228 | 1230 | <var>paymentMethodvar> tuple.
|
1229 | 1231 | 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 |
1244 | 1235 | algorithm.
|
1245 | 1236 | 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> |
1261 | 1237 | ol>
|
1262 | 1238 | li>
|
1263 |
| - <li>Resolve <var>promisevar> with false. |
| 1239 | + <li>Resolve <var>hasHandlerPromisevar> with false. |
1264 | 1240 | li>
|
1265 | 1241 | ol>
|
1266 | 1242 | section>
|
|
0 commit comments