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

Unified Diff: chrome/test/data/payments/payment_request_id.js

Issue 2770193003: Implement request id in PaymentDetailsInit (Closed)
Patch Set: Rebase once more since mojom file moved Created 3 years, 8 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/payment_request_id.js
diff --git a/chrome/test/data/payments/payment_request_id.js b/chrome/test/data/payments/payment_request_id.js
new file mode 100644
index 0000000000000000000000000000000000000000..abfda37a45820997cd71f8dbd81b7da214803672
--- /dev/null
+++ b/chrome/test/data/payments/payment_request_id.js
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+
+/**
+ * Launches the PaymentRequest UI including a details.id and prints the
+ * resulting requestId.
+ */
+function buy() { // eslint-disable-line no-unused-vars
+ try {
+ new PaymentRequest(
+ [{supportedMethods: ['visa']}],
+ {id: 'my_payment_id',
+ total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}}})
+ .show()
+ .then(function(resp) {
+ resp.complete('success')
+ .then(function() {
+ print(resp.requestId);
+ })
+ .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