Chromium Code Reviews| Index: chrome/test/data/payments/bobpay_and_cards_with_modifiers.js |
| diff --git a/chrome/test/data/payments/bobpay_and_cards_with_modifiers.js b/chrome/test/data/payments/bobpay_and_cards_with_modifiers.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..681471adc5fcc1faa00ab72687ed487508aa5fad |
| --- /dev/null |
| +++ b/chrome/test/data/payments/bobpay_and_cards_with_modifiers.js |
| @@ -0,0 +1,50 @@ |
| +/* |
| + * Copyright 2016 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 */ |
| + |
| +/** |
| + * Launches the PaymentRequest UI with Bob Pay and credit cards as payment |
| + * methods. |
| + */ |
| +function buy() { // eslint-disable-line no-unused-vars |
| + try { |
| + new PaymentRequest( |
| + [{supportedMethods: ['https://bobpay.com', 'visa', 'mastercard']}], |
|
gogerald1
2017/05/17 19:11:47
nit: it's better to use basic-card since we will r
wuandy1
2017/05/18 20:12:29
Done.
|
| + { |
| + total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}}, |
| + modifiers: [{ |
| + supportedMethods: ['https://bobpay.com'], |
| + total: { |
| + label: 'Total', |
| + amount: {currency: 'USD', value: '4.00'} |
| + }, |
| + additionalDisplayItems: [{ |
| + label: 'BobPay discount', |
| + amount: {currency: 'USD', value: '-1.00'} |
| + }], |
| + data: {discountProgramParticipantId: '86328764873265'} |
| + }], |
| + }) |
| + .show() |
| + .then(function(resp) { |
| + resp.complete('success') |
| + .then(function() { |
| + print( |
| + resp.methodName + '<br>' + |
| + JSON.stringify(resp.details, undefined, 2)); |
| + }) |
| + .catch(function(error) { |
| + print(error.message); |
| + }); |
| + }) |
| + .catch(function(error) { |
| + print(error.message); |
| + }); |
| + } catch (error) { |
| + print(error.message); |
| + } |
| +} |