| OLD | NEW |
| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 }; | 120 }; |
| 121 | 121 |
| 122 struct PaymentOptions { | 122 struct PaymentOptions { |
| 123 bool request_payer_name; | 123 bool request_payer_name; |
| 124 bool request_payer_email; | 124 bool request_payer_email; |
| 125 bool request_payer_phone; | 125 bool request_payer_phone; |
| 126 bool request_shipping; | 126 bool request_shipping; |
| 127 PaymentShippingType shipping_type; | 127 PaymentShippingType shipping_type; |
| 128 }; | 128 }; |
| 129 | 129 |
| 130 enum AndroidPayEnvironment { |
| 131 PRODUCTION, |
| 132 TEST |
| 133 }; |
| 134 |
| 135 enum AndroidPayCardNetwork { |
| 136 AMEX, |
| 137 DISCOVER, |
| 138 MASTERCARD, |
| 139 VISA |
| 140 }; |
| 141 |
| 142 enum AndroidPayTokenization { |
| 143 UNSPECIFIED, |
| 144 GATEWAY_TOKEN, |
| 145 NETWORK_TOKEN |
| 146 }; |
| 147 |
| 148 struct AndroidPayTokenizationParameter { |
| 149 string? key; |
| 150 string? value; |
| 151 }; |
| 152 |
| 130 struct PaymentMethodData { | 153 struct PaymentMethodData { |
| 131 array<string> supported_methods; | 154 array<string> supported_methods; |
| 155 |
| 132 // A JSON string built by the renderer from a JavaScript object that the | 156 // A JSON string built by the renderer from a JavaScript object that the |
| 133 // merchant website provides. The renderer uses | 157 // merchant website provides. The renderer uses |
| 134 // blink::JSONObject::toJSONString() to generate this string. The browser | 158 // blink::JSONObject::toJSONString() to generate this string. The browser does |
| 135 // parses the string via JSONObject(JsonSanitizer.sanitize(stringified_data)) | 159 // not parse the string and passes it as-is directly to payment apps. There's |
| 136 // and passes a part of the JSON object to the payment app, for example | 160 // no one format for this object, so richer types cannot be used. A simple |
| 137 // Android Pay. There's no one format for this object, so richer types cannot | 161 // example: |
| 138 // be used. A simple example: | |
| 139 // | 162 // |
| 140 // {"gateway": "stripe"} | 163 // {"gateway": "stripe"} |
| 141 string stringified_data; | 164 string stringified_data; |
| 165 |
| 166 // Android Pay specific method data is parsed in the renderer. |
| 167 // https://developers.google.com/web/fundamentals/getting-started/primers/paym
ent-request/android-pay |
| 168 // TODO(rouslan): Stop parsing Android Pay data. http://crbug.com/620173 |
| 169 AndroidPayEnvironment environment; |
| 170 string? merchant_name; |
| 171 string? merchant_id; |
| 172 array<AndroidPayCardNetwork> allowed_card_networks; |
| 173 AndroidPayTokenization tokenization_type; |
| 174 array<AndroidPayTokenizationParameter> parameters; |
| 142 }; | 175 }; |
| 143 | 176 |
| 144 enum PaymentComplete { | 177 enum PaymentComplete { |
| 145 SUCCESS, | 178 SUCCESS, |
| 146 FAIL, | 179 FAIL, |
| 147 UNKNOWN | 180 UNKNOWN |
| 148 }; | 181 }; |
| 149 | 182 |
| 150 interface PaymentRequest { | 183 interface PaymentRequest { |
| 151 Init(PaymentRequestClient client, | 184 Init(PaymentRequestClient client, |
| 152 array<PaymentMethodData> methodData, | 185 array<PaymentMethodData> methodData, |
| 153 PaymentDetails details, | 186 PaymentDetails details, |
| 154 PaymentOptions options); | 187 PaymentOptions options); |
| 155 Show(); | 188 Show(); |
| 156 UpdateWith(PaymentDetails details); | 189 UpdateWith(PaymentDetails details); |
| 157 Abort(); | 190 Abort(); |
| 158 Complete(PaymentComplete result); | 191 Complete(PaymentComplete result); |
| 159 }; | 192 }; |
| OLD | NEW |