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

Unified Diff: chrome/test/data/android/payments/active_payment_query_cc.js

Issue 2516923002: [Merge M-56] Add canMakeActivePayment() method to web payments. (Closed)
Patch Set: Created 4 years, 1 month 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/android/payments/active_payment_query_cc.js
diff --git a/chrome/test/data/android/payments/active_payment_query_cc.js b/chrome/test/data/android/payments/active_payment_query_cc.js
new file mode 100644
index 0000000000000000000000000000000000000000..4497b4b8f486dbda79917a996875fa4c84f42dcc
--- /dev/null
+++ b/chrome/test/data/android/payments/active_payment_query_cc.js
@@ -0,0 +1,48 @@
+/*
+ * 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 */
+/* global print:false */
+
+/**
+ * Checks for existence of a complete VISA credit card.
+ */
+function buy() { // eslint-disable-line no-unused-vars
+ try {
+ var request = new PaymentRequest(
+ [{supportedMethods: ['visa']}],
+ {total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}}});
+ request.canMakeActivePayment()
+ .then(function(result) {
+ print(result);
+ })
+ .catch(function(error) {
+ print(error);
+ });
+ } catch (error) {
+ print(error.message);
+ }
+}
+
+/**
+ * Checks for existence of a complete MasterCard credit card.
+ */
+function other_buy() { // eslint-disable-line no-unused-vars
+ try {
+ var request = new PaymentRequest(
+ [{supportedMethods: ['mastercard']}],
+ {total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}}});
+ request.canMakeActivePayment()
+ .then(function(result) {
+ print(result);
+ })
+ .catch(function(error) {
+ print(error);
+ });
+ } catch (error) {
+ print(error.message);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698