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

Side by Side Diff: chrome/test/data/payments/shipping_address_change.js

Issue 2828913002: [Payments] Normalize Shipping Address Change on Android. (Closed)
Patch Set: Addressed comment 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 unified diff | Download patch
« no previous file with comments | « chrome/test/data/payments/payment_request_shipping_address_change_test.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2017 The Chromium Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
5 */
6
7 /**
8 * Launches the PaymentRequest UI that prints the shipping address received
9 * on shippingAddressChange events at the end of the transaction.
10 */
11 function buy() { // eslint-disable-line no-unused-vars
12 try {
13 var details = {
14 total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}},
15 displayItems: [
16 {
17 label: 'Pending shipping price',
18 amount: {currency: 'USD', value: '0.00'},
19 pending: true
20 },
21 {
22 label: 'Subtotal',
23 amount: {currency: 'USD', value: '5.00'}
24 }
25 ]
26 };
27
28 var request = new PaymentRequest(
29 [{supportedMethods: ['visa']}], details, {requestShipping: true});
30
31 var shippingAddressChange;
32
33 request.addEventListener('shippingaddresschange', function(evt) {
34 evt.updateWith(new Promise(function(resolve) {
35 print(JSON.stringify(request.shippingAddress, undefined, 2));
36 resolve(details);
37 }));
38 });
39
40 request.show();
41 } catch (error) {
42 print(error.message);
43 }
44 }
OLDNEW
« no previous file with comments | « chrome/test/data/payments/payment_request_shipping_address_change_test.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698