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

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

Issue 2501593003: Implement the new basic card specification. (Closed)
Patch Set: 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 payments.mojom; 6 module payments.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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 UNSPECIFIED, 150 UNSPECIFIED,
151 GATEWAY_TOKEN, 151 GATEWAY_TOKEN,
152 NETWORK_TOKEN 152 NETWORK_TOKEN
153 }; 153 };
154 154
155 struct AndroidPayTokenizationParameter { 155 struct AndroidPayTokenizationParameter {
156 string? key; 156 string? key;
157 string? value; 157 string? value;
158 }; 158 };
159 159
160 enum BasicCardNetwork {
161 AMEX,
162 DINERS,
163 DISCOVER,
164 JCB,
165 MASTERCARD,
166 UNIONPAY,
167 VISA
168 };
169
170 enum BasicCardType {
171 CREDIT,
172 DEBIT,
173 PREPAID
174 };
175
160 struct PaymentMethodData { 176 struct PaymentMethodData {
161 array<string> supported_methods; 177 array<string> supported_methods;
162 178
163 // A JSON string built by the renderer from a JavaScript object that the 179 // A JSON string built by the renderer from a JavaScript object that the
164 // merchant website provides. The renderer uses 180 // merchant website provides. The renderer uses
165 // blink::JSONObject::toJSONString() to generate this string. The browser does 181 // blink::JSONObject::toJSONString() to generate this string. The browser does
166 // not parse the string and passes it as-is directly to payment apps. There's 182 // not parse the string and passes it as-is directly to payment apps. There's
167 // no one format for this object, so richer types cannot be used. A simple 183 // no one format for this object, so richer types cannot be used. A simple
168 // example: 184 // example:
169 // 185 //
170 // {"gateway": "stripe"} 186 // {"gateway": "stripe"}
171 string stringified_data; 187 string stringified_data;
172 188
173 // Android Pay specific method data is parsed in the renderer. 189 // Android Pay specific method data is parsed in the renderer.
174 // https://developers.google.com/web/fundamentals/getting-started/primers/paym ent-request/android-pay 190 // https://developers.google.com/web/fundamentals/getting-started/primers/paym ent-request/android-pay
175 // TODO(rouslan): Stop parsing Android Pay data. http://crbug.com/620173 191 // TODO(rouslan): Stop parsing Android Pay data. http://crbug.com/620173
176 AndroidPayEnvironment environment; 192 AndroidPayEnvironment environment;
177 string? merchant_name; 193 string? merchant_name;
178 string? merchant_id; 194 string? merchant_id;
179 array<AndroidPayCardNetwork> allowed_card_networks; 195 array<AndroidPayCardNetwork> allowed_card_networks;
180 AndroidPayTokenization tokenization_type; 196 AndroidPayTokenization tokenization_type;
181 array<AndroidPayTokenizationParameter> parameters; 197 array<AndroidPayTokenizationParameter> parameters;
198
199 // Basic card specific method data is parsed in the renderer.
200 array<BasicCardNetwork> supported_networks;
201 array<BasicCardType> supported_types;
182 }; 202 };
183 203
184 enum PaymentComplete { 204 enum PaymentComplete {
185 SUCCESS, 205 SUCCESS,
186 FAIL, 206 FAIL,
187 UNKNOWN 207 UNKNOWN
188 }; 208 };
189 209
190 interface PaymentRequest { 210 interface PaymentRequest {
191 Init(PaymentRequestClient client, 211 Init(PaymentRequestClient client,
192 array<PaymentMethodData> methodData, 212 array<PaymentMethodData> methodData,
193 PaymentDetails details, 213 PaymentDetails details,
194 PaymentOptions options); 214 PaymentOptions options);
195 Show(); 215 Show();
196 UpdateWith(PaymentDetails details); 216 UpdateWith(PaymentDetails details);
197 Abort(); 217 Abort();
198 Complete(PaymentComplete result); 218 Complete(PaymentComplete result);
199 CanMakeActivePayment(); 219 CanMakeActivePayment();
200 }; 220 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698