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

Side by Side Diff: components/payments/payment_request.mojom

Issue 2470463002: Add data parameter to payment details modifier. (Closed)
Patch Set: Add comments and rebase 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 [JavaPackage="org.chromium.payments.mojom"] 5 [JavaPackage="org.chromium.payments.mojom"]
6 module blink.mojom; 6 module blink.mojom;
7 7
8 // The shipping address that the browser process provides to the renderer 8 // The shipping address that the browser process provides to the renderer
9 // process. Built either by the browser or a payment app. 9 // process. Built either by the browser or a payment app.
10 struct PaymentAddress { 10 struct PaymentAddress {
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 string id; 90 string id;
91 string label; 91 string label;
92 PaymentCurrencyAmount amount; 92 PaymentCurrencyAmount amount;
93 bool selected; 93 bool selected;
94 }; 94 };
95 95
96 struct PaymentDetailsModifier { 96 struct PaymentDetailsModifier {
97 array<string> supported_methods; 97 array<string> supported_methods;
98 PaymentItem? total; 98 PaymentItem? total;
99 array<PaymentItem> additional_display_items; 99 array<PaymentItem> additional_display_items;
100 // A JSON string built by the renderer from a JavaScript object that the
Tom Sepez 2016/11/02 20:23:22 Parsing such an object in the browser is generally
please use gerrit instead 2016/11/02 20:35:17 PaymentRequestImpl.java sanitizes and parses the s
101 // merchant website provides. The renderer uses
102 // blink::JSONObject::toJSONString() to generate this string. The browser
103 // parses the string via JSONObject(JsonSanitizer.sanitize(stringified_data))
104 // and passes a part of the JSON object to the payment app, for example
105 // Android Pay. There's no one format for this object, so richer types cannot
106 // be used. A simple example:
107 //
108 // {"gateway": "stripe"}
109 string stringified_data;
100 }; 110 };
101 111
102 struct PaymentDetails { 112 struct PaymentDetails {
103 PaymentItem total; 113 PaymentItem total;
104 array<PaymentItem> display_items; 114 array<PaymentItem> display_items;
105 array<PaymentShippingOption> shipping_options; 115 array<PaymentShippingOption> shipping_options;
106 array<PaymentDetailsModifier> modifiers; 116 array<PaymentDetailsModifier> modifiers;
107 string error; 117 string error;
108 }; 118 };
109 119
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 interface PaymentRequest { 154 interface PaymentRequest {
145 Init(PaymentRequestClient client, 155 Init(PaymentRequestClient client,
146 array<PaymentMethodData> methodData, 156 array<PaymentMethodData> methodData,
147 PaymentDetails details, 157 PaymentDetails details,
148 PaymentOptions options); 158 PaymentOptions options);
149 Show(); 159 Show();
150 UpdateWith(PaymentDetails details); 160 UpdateWith(PaymentDetails details);
151 Abort(); 161 Abort();
152 Complete(PaymentComplete result); 162 Complete(PaymentComplete result);
153 }; 163 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698