Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1282)

Side by Side Diff: chrome/test/data/payments/can_make_payment_query_cc.js

Issue 2866623003: PaymentRequest.canMakePayment() query quota on desktop. (Closed)
Patch Set: frame Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2016 The Chromium Authors. All rights reserved. 2 * Copyright 2016 The Chromium Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 /* global PaymentRequest:false */
8 /* global print:false */
9
10 /** 7 /**
11 * Checks for existence of a complete VISA credit card. 8 * Checks for existence of a complete VISA credit card.
12 */ 9 */
13 function buy() { // eslint-disable-line no-unused-vars 10 function buy() { // eslint-disable-line no-unused-vars
14 try { 11 try {
15 var request = new PaymentRequest( 12 const request = new PaymentRequest(
16 [{supportedMethods: ['visa']}], 13 [{supportedMethods: ['visa']}],
17 {total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}}}); 14 {total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}}});
18 request.canMakePayment() 15 request.canMakePayment()
19 .then(function(result) { 16 .then(function(result) {
20 print(result); 17 print(result);
21 }) 18 })
22 .catch(function(error) { 19 .catch(function(error) {
23 print(error); 20 print(error);
24 }); 21 });
25 } catch (error) { 22 } catch (error) {
26 print(error.message); 23 print(error.message);
27 } 24 }
28 } 25 }
29 26
30 /** 27 /**
31 * Checks for existence of a complete MasterCard credit card. 28 * Checks for existence of a complete MasterCard credit card.
32 */ 29 */
33 function other_buy() { // eslint-disable-line no-unused-vars 30 function other_buy() { // eslint-disable-line no-unused-vars, camelcase
34 try { 31 try {
35 var request = new PaymentRequest( 32 const request = new PaymentRequest(
36 [{supportedMethods: ['mastercard']}], 33 [{supportedMethods: ['mastercard']}],
37 {total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}}}); 34 {total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}}});
38 request.canMakePayment() 35 request.canMakePayment()
39 .then(function(result) { 36 .then(function(result) {
40 print(result); 37 print(result);
41 }) 38 })
42 .catch(function(error) { 39 .catch(function(error) {
43 print(error); 40 print(error);
44 }); 41 });
45 } catch (error) { 42 } catch (error) {
46 print(error.message); 43 print(error.message);
47 } 44 }
48 } 45 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/payments/payment_request_can_make_payment_browsertest.cc ('k') | components/payments/content/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698