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

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

Issue 2623653003: [Payments] Move Payment Request test files to chrome/test/data/payments (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « chrome/test/data/android/payments/abort.js ('k') | chrome/test/data/android/payments/bobpay.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/android/payments/basic_card.js
diff --git a/chrome/test/data/android/payments/basic_card.js b/chrome/test/data/android/payments/basic_card.js
deleted file mode 100644
index ce2201404e94af48c0ed7d99b9e037472117b92f..0000000000000000000000000000000000000000
--- a/chrome/test/data/android/payments/basic_card.js
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
- * 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.
- */
-
-/**
- * Merchant checks for ability to pay using debit cards.
- */
-function checkBasicDebit() { // eslint-disable-line no-unused-vars
- try {
- new PaymentRequest(
- [{
- supportedMethods: ['basic-card'],
- data: {
- supportedTypes: ['debit'],
- },
- }], {
- total: {
- label: 'Total',
- amount: {
- currency: 'USD',
- value: '5.00',
- },
- },
- })
- .canMakePayment()
- .then(function(result) {
- print(result);
- })
- .catch(function(error) {
- print(error);
- });
- } catch (error) {
- print(error);
- }
-}
-
-/**
- * Merchant checks for ability to pay using "basic-card" with "mastercard" as
- * the supported network.
- */
-function checkBasicMasterCard() { // eslint-disable-line no-unused-vars
- try {
- new PaymentRequest(
- [{
- supportedMethods: ['basic-card'],
- data: {
- supportedNetworks: ['mastercard'],
- },
- }], {
- total: {
- label: 'Total',
- amount: {
- currency: 'USD',
- value: '5.00',
- },
- },
- })
- .canMakePayment()
- .then(function(result) {
- print(result);
- })
- .catch(function(error) {
- print(error);
- });
- } catch (error) {
- print(error);
- }
-}
-
-/**
- * Merchant checks for ability to pay using "basic-card" with "visa" as the
- * supported network.
- */
-function checkBasicVisa() { // eslint-disable-line no-unused-vars
- try {
- new PaymentRequest(
- [{
- supportedMethods: ['basic-card'],
- data: {
- supportedNetworks: ['visa'],
- },
- }], {
- total: {
- label: 'Total',
- amount: {
- currency: 'USD',
- value: '5.00',
- },
- },
- })
- .canMakePayment()
- .then(function(result) {
- print(result);
- })
- .catch(function(error) {
- print(error);
- });
- } catch (error) {
- print(error);
- }
-}
-
-/**
- * Merchant checks for ability to pay using "mastercard".
- */
-function checkMasterCard() { // eslint-disable-line no-unused-vars
- try {
- new PaymentRequest(
- [{
- supportedMethods: ['mastercard'],
- }], {
- total: {
- label: 'Total',
- amount: {
- currency: 'USD',
- value: '5.00',
- },
- },
- })
- .canMakePayment()
- .then(function(result) {
- print(result);
- })
- .catch(function(error) {
- print(error);
- });
- } catch (error) {
- print(error);
- }
-}
-
-/**
- * Merchant checks for ability to pay using "visa".
- */
-function checkVisa() { // eslint-disable-line no-unused-vars
- try {
- new PaymentRequest(
- [{
- supportedMethods: ['visa'],
- }], {
- total: {
- label: 'Total',
- amount: {
- currency: 'USD',
- value: '5.00',
- },
- },
- })
- .canMakePayment()
- .then(function(result) {
- print(result);
- })
- .catch(function(error) {
- print(error);
- });
- } catch (error) {
- print(error);
- }
-}
-
-/**
- * Merchant requests payment via either "mastercard" or "basic-card" with "visa"
- * as the supported network.
- */
-function buy() { // eslint-disable-line no-unused-vars
- try {
- new PaymentRequest(
- [{
- supportedMethods: ['mastercard'],
- }, {
- supportedMethods: ['basic-card'],
- data: {
- supportedNetworks: ['visa'],
- },
- }], {
- total: {
- label: 'Total',
- amount: {
- currency: 'USD',
- value: '5.00',
- },
- },
- })
- .show()
- .then(function(response) {
- response.complete('success').then(function() {
- print(JSON.stringify(response, undefined, 2));
- }).catch(function(error) {
- print(error);
- });
- })
- .catch(function(error) {
- print(error);
- });
- } catch (error) {
- print(error);
- }
-}
-
-/**
- * Merchant requests payment via "basic-card" with "debit" as the supported card
- * type.
- */
-function buyBasicDebit() { // eslint-disable-line no-unused-vars
- try {
- new PaymentRequest(
- [{
- supportedMethods: ['basic-card'],
- data: {
- supportedTypes: ['debit'],
- },
- }], {
- total: {
- label: 'Total',
- amount: {
- currency: 'USD',
- value: '5.00',
- },
- },
- })
- .show()
- .then(function(response) {
- response.complete('success').then(function() {
- print(JSON.stringify(response, undefined, 2));
- }).catch(function(error) {
- print(error);
- });
- })
- .catch(function(error) {
- print(error);
- });
- } catch (error) {
- print(error);
- }
-}
-
-/**
- * Merchant requests payment via "basic-card" payment method with "mastercard"
- * as the only supported network.
- */
-function buyBasicMasterCard() { // eslint-disable-line no-unused-vars
- try {
- new PaymentRequest(
- [{
- supportedMethods: ['basic-card'],
- data: {
- supportedNetworks: ['mastercard'],
- },
- }], {
- total: {
- label: 'Total',
- amount: {
- currency: 'USD',
- value: '5.00',
- },
- },
- })
- .show()
- .then(function(response) {
- response.complete('success').then(function() {
- print(JSON.stringify(response, undefined, 2));
- }).catch(function(error) {
- print(error);
- });
- })
- .catch(function(error) {
- print(error);
- });
- } catch (error) {
- print(error);
- }
-}
« no previous file with comments | « chrome/test/data/android/payments/abort.js ('k') | chrome/test/data/android/payments/bobpay.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698