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

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

Issue 2885443003: enable modifiers for native apps (Closed)
Patch Set: fix compilation error 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
(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 */
8
9 /**
10 * Launches the PaymentRequest UI with Bob Pay and basic-card as payment
11 * methods.
12 */
13 function buy() { // eslint-disable-line no-unused-vars
14 try {
15 new PaymentRequest(
16 [{supportedMethods: ['https://bobpay.com', 'basic-card']}],
17 {
18 total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}},
19 modifiers: [{
20 supportedMethods: ['https://bobpay.com'],
21 total: {
22 label: 'Total',
23 amount: {currency: 'USD', value: '4.00'}
24 },
25 additionalDisplayItems: [{
26 label: 'BobPay discount',
27 amount: {currency: 'USD', value: '-1.00'}
28 }],
29 data: {discountProgramParticipantId: '86328764873265'}
30 }],
31 })
32 .show()
33 .then(function(resp) {
34 resp.complete('success')
35 .then(function() {
36 print(
37 resp.methodName + '<br>' +
38 JSON.stringify(resp.details, undefined, 2));
39 })
40 .catch(function(error) {
41 print(error.message);
42 });
43 })
44 .catch(function(error) {
45 print(error.message);
46 });
47 } catch (error) {
48 print(error.message);
49 }
50 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698