OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright 2017 The Chromium Authors. All rights reserved. | |
3 * Use of this source code is governed by a BSD-style license that can be | |
4 * found in the LICENSE file. | |
5 */ | |
6 | |
7 /* global PaymentRequest:false */ | |
please use gerrit instead
2017/03/27 21:16:05
No longer necessary, because latest linters are aw
| |
8 | |
9 var request; | |
please use gerrit instead
2017/03/27 21:16:05
Not necessary.
| |
10 | |
11 /** | |
12 * Launches the PaymentRequest UI including a details.id and prints the | |
13 * resulting requestId. | |
14 */ | |
15 function buy() { // eslint-disable-line no-unused-vars | |
16 try { | |
17 new PaymentRequest( | |
18 [{supportedMethods: ['visa']}], | |
19 {id: 'my_payment_id', | |
20 total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}}}) | |
21 .show() | |
22 .then(function(resp) { | |
23 resp.complete('success') | |
24 .then(function() { | |
25 print(resp.requestId); | |
26 }) | |
27 .catch(function(error) { | |
28 print(error.message); | |
29 }); | |
30 }) | |
31 .catch(function(error) { | |
32 print(error.message); | |
33 }); | |
34 } catch (error) { | |
35 print(error.message); | |
36 } | |
37 } | |
OLD | NEW |