| 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 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 }; | 99 }; |
| 100 | 100 |
| 101 struct PaymentDetails { | 101 struct PaymentDetails { |
| 102 PaymentItem total; | 102 PaymentItem total; |
| 103 array<PaymentItem> display_items; | 103 array<PaymentItem> display_items; |
| 104 array<PaymentShippingOption> shipping_options; | 104 array<PaymentShippingOption> shipping_options; |
| 105 array<PaymentDetailsModifier> modifiers; | 105 array<PaymentDetailsModifier> modifiers; |
| 106 string error; | 106 string error; |
| 107 }; | 107 }; |
| 108 | 108 |
| 109 enum PaymentShippingType { |
| 110 SHIPPING, |
| 111 DELIVERY, |
| 112 PICKUP |
| 113 }; |
| 114 |
| 109 struct PaymentOptions { | 115 struct PaymentOptions { |
| 110 bool request_payer_name; | 116 bool request_payer_name; |
| 111 bool request_payer_email; | 117 bool request_payer_email; |
| 112 bool request_payer_phone; | 118 bool request_payer_phone; |
| 113 bool request_shipping; | 119 bool request_shipping; |
| 120 PaymentShippingType shipping_type; |
| 114 }; | 121 }; |
| 115 | 122 |
| 116 struct PaymentMethodData { | 123 struct PaymentMethodData { |
| 117 array<string> supported_methods; | 124 array<string> supported_methods; |
| 118 // A JSON string built by the renderer from a JavaScript object that the | 125 // A JSON string built by the renderer from a JavaScript object that the |
| 119 // merchant website provides. The renderer uses | 126 // merchant website provides. The renderer uses |
| 120 // blink::JSONObject::toJSONString() to generate this string. The browser | 127 // blink::JSONObject::toJSONString() to generate this string. The browser |
| 121 // parses the string via JSONObject(JsonSanitizer.sanitize(stringified_data)) | 128 // parses the string via JSONObject(JsonSanitizer.sanitize(stringified_data)) |
| 122 // and passes a part of the JSON object to the payment app, for example | 129 // and passes a part of the JSON object to the payment app, for example |
| 123 // Android Pay. There's no one format for this object, so richer types cannot | 130 // Android Pay. There's no one format for this object, so richer types cannot |
| (...skipping 12 matching lines...) Expand all Loading... |
| 136 interface PaymentRequest { | 143 interface PaymentRequest { |
| 137 Init(PaymentRequestClient client, | 144 Init(PaymentRequestClient client, |
| 138 array<PaymentMethodData> methodData, | 145 array<PaymentMethodData> methodData, |
| 139 PaymentDetails details, | 146 PaymentDetails details, |
| 140 PaymentOptions options); | 147 PaymentOptions options); |
| 141 Show(); | 148 Show(); |
| 142 UpdateWith(PaymentDetails details); | 149 UpdateWith(PaymentDetails details); |
| 143 Abort(); | 150 Abort(); |
| 144 Complete(PaymentComplete result); | 151 Complete(PaymentComplete result); |
| 145 }; | 152 }; |
| OLD | NEW |