Chromium Code Reviews| Index: chrome/test/data/payments/payment_request_id.js |
| diff --git a/chrome/test/data/payments/payment_request_id.js b/chrome/test/data/payments/payment_request_id.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4938b9a62484bfc3e6ad7ebf5f516093beb97928 |
| --- /dev/null |
| +++ b/chrome/test/data/payments/payment_request_id.js |
| @@ -0,0 +1,37 @@ |
| +/* |
| + * Copyright 2017 The Chromium Authors. All rights reserved. |
| + * Use of this source code is governed by a BSD-style license that can be |
| + * found in the LICENSE file. |
| + */ |
| + |
| +/* global PaymentRequest:false */ |
|
please use gerrit instead
2017/03/27 21:16:05
No longer necessary, because latest linters are aw
|
| + |
| +var request; |
|
please use gerrit instead
2017/03/27 21:16:05
Not necessary.
|
| + |
| +/** |
| + * Launches the PaymentRequest UI including a details.id and prints the |
| + * resulting requestId. |
| + */ |
| +function buy() { // eslint-disable-line no-unused-vars |
| + try { |
| + new PaymentRequest( |
| + [{supportedMethods: ['visa']}], |
| + {id: 'my_payment_id', |
| + total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}}}) |
| + .show() |
| + .then(function(resp) { |
| + resp.complete('success') |
| + .then(function() { |
| + print(resp.requestId); |
| + }) |
| + .catch(function(error) { |
| + print(error.message); |
| + }); |
| + }) |
| + .catch(function(error) { |
| + print(error.message); |
| + }); |
| + } catch (error) { |
| + print(error.message); |
| + } |
| +} |