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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/payments/bobpay_and_basic_card_with_modifiers.js
diff --git a/chrome/test/data/payments/bobpay_and_basic_card_with_modifiers.js b/chrome/test/data/payments/bobpay_and_basic_card_with_modifiers.js
new file mode 100644
index 0000000000000000000000000000000000000000..0a3c73229a7feecee2feef3638a8548e7ea1ff57
--- /dev/null
+++ b/chrome/test/data/payments/bobpay_and_basic_card_with_modifiers.js
@@ -0,0 +1,50 @@
+/*
+ * 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 */
+
+/**
+ * Launches the PaymentRequest UI with Bob Pay and basic-card as payment
+ * methods.
+ */
+function buy() { // eslint-disable-line no-unused-vars
+ try {
+ new PaymentRequest(
+ [{supportedMethods: ['https://bobpay.com', 'basic-card']}],
+ {
+ 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);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698