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

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

Issue 2501593003: Implement the new basic card specification. (Closed)
Patch Set: Rebase 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 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 bool pending; 99 bool pending;
100 }; 100 };
101 101
102 struct PaymentShippingOption { 102 struct PaymentShippingOption {
103 string id; 103 string id;
104 string label; 104 string label;
105 PaymentCurrencyAmount amount; 105 PaymentCurrencyAmount amount;
106 bool selected; 106 bool selected;
107 }; 107 };
108 108
109 enum AndroidPayEnvironment {
110 PRODUCTION,
111 TEST
112 };
113
114 enum AndroidPayCardNetwork {
115 AMEX,
116 DISCOVER,
117 MASTERCARD,
118 VISA
119 };
120
121 enum AndroidPayTokenization {
122 UNSPECIFIED,
123 GATEWAY_TOKEN,
124 NETWORK_TOKEN
125 };
126
127 struct AndroidPayTokenizationParameter {
128 string? key;
129 string? value;
130 };
131
132 enum BasicCardNetwork {
133 AMEX,
134 DINERS,
135 DISCOVER,
136 JCB,
137 MASTERCARD,
138 UNIONPAY,
139 VISA
140 };
141
142 enum BasicCardType {
143 CREDIT,
144 DEBIT,
145 PREPAID
146 };
147
109 struct PaymentMethodData { 148 struct PaymentMethodData {
110 array<string> supported_methods; 149 array<string> supported_methods;
111 150
112 // A JSON string built by the renderer from a JavaScript object that the 151 // A JSON string built by the renderer from a JavaScript object that the
113 // merchant website provides. The renderer uses 152 // merchant website provides. The renderer uses
114 // blink::JSONObject::toJSONString() to generate this string. The browser does 153 // blink::JSONObject::toJSONString() to generate this string. The browser does
115 // not parse the string and passes it as-is directly to payment apps. There's 154 // not parse the string and passes it as-is directly to payment apps. There's
116 // no one format for this object, so more specific types cannot be used. A 155 // no one format for this object, so more specific types cannot be used. A
117 // simple example: 156 // simple example:
118 // 157 //
119 // {"gateway": "stripe"} 158 // {"gateway": "stripe"}
120 string stringified_data; 159 string stringified_data;
121 160
122 // Android Pay specific method data is parsed in the renderer. 161 // Android Pay specific method data is parsed in the renderer.
123 // https://developers.google.com/web/fundamentals/getting-started/primers/paym ent-request/android-pay 162 // https://developers.google.com/web/fundamentals/getting-started/primers/paym ent-request/android-pay
124 // TODO(rouslan): Stop parsing Android Pay data. http://crbug.com/620173 163 // TODO(rouslan): Stop parsing Android Pay data. http://crbug.com/620173
125 AndroidPayEnvironment environment; 164 AndroidPayEnvironment environment;
126 string? merchant_name; 165 string? merchant_name;
127 string? merchant_id; 166 string? merchant_id;
128 array<AndroidPayCardNetwork> allowed_card_networks; 167 array<AndroidPayCardNetwork> allowed_card_networks;
129 AndroidPayTokenization tokenization_type; 168 AndroidPayTokenization tokenization_type;
130 array<AndroidPayTokenizationParameter> parameters; 169 array<AndroidPayTokenizationParameter> parameters;
131 // Value of 0 means the merchant did not specify or it was an invalid value. 170 // Value of 0 means the merchant did not specify or it was an invalid value.
132 int32 min_google_play_services_version; 171 int32 min_google_play_services_version;
172
173 // Basic card specific method data is parsed in the renderer.
174 array<BasicCardNetwork> supported_networks;
175 array<BasicCardType> supported_types;
133 }; 176 };
134 177
135 struct PaymentDetailsModifier { 178 struct PaymentDetailsModifier {
136 PaymentItem? total; 179 PaymentItem? total;
137 array<PaymentItem> additional_display_items; 180 array<PaymentItem> additional_display_items;
138 PaymentMethodData method_data; 181 PaymentMethodData method_data;
139 }; 182 };
140 183
141 struct PaymentDetails { 184 struct PaymentDetails {
142 PaymentItem total; 185 PaymentItem total;
(...skipping 10 matching lines...) Expand all
153 }; 196 };
154 197
155 struct PaymentOptions { 198 struct PaymentOptions {
156 bool request_payer_name; 199 bool request_payer_name;
157 bool request_payer_email; 200 bool request_payer_email;
158 bool request_payer_phone; 201 bool request_payer_phone;
159 bool request_shipping; 202 bool request_shipping;
160 PaymentShippingType shipping_type; 203 PaymentShippingType shipping_type;
161 }; 204 };
162 205
163 enum AndroidPayEnvironment {
164 PRODUCTION,
165 TEST
166 };
167
168 enum AndroidPayCardNetwork {
169 AMEX,
170 DISCOVER,
171 MASTERCARD,
172 VISA
173 };
174
175 enum AndroidPayTokenization {
176 UNSPECIFIED,
177 GATEWAY_TOKEN,
178 NETWORK_TOKEN
179 };
180
181 struct AndroidPayTokenizationParameter {
182 string? key;
183 string? value;
184 };
185
186 enum PaymentComplete { 206 enum PaymentComplete {
187 SUCCESS, 207 SUCCESS,
188 FAIL, 208 FAIL,
189 UNKNOWN 209 UNKNOWN
190 }; 210 };
191 211
192 interface PaymentRequest { 212 interface PaymentRequest {
193 Init(PaymentRequestClient client, 213 Init(PaymentRequestClient client,
194 array<PaymentMethodData> methodData, 214 array<PaymentMethodData> methodData,
195 PaymentDetails details, 215 PaymentDetails details,
196 PaymentOptions options); 216 PaymentOptions options);
197 Show(); 217 Show();
198 UpdateWith(PaymentDetails details); 218 UpdateWith(PaymentDetails details);
199 Abort(); 219 Abort();
200 Complete(PaymentComplete result); 220 Complete(PaymentComplete result);
201 CanMakePayment(); 221 CanMakePayment();
202 }; 222 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698