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.mojom.payments"] | 5 [JavaPackage="org.chromium.mojom.payments"] |
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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 // be successfully parsed into base::JSONParser. Renderer parses this string | 54 // be successfully parsed into base::JSONParser. Renderer parses this string |
55 // via v8::JSON::Parse() and hands off the result to the merchant website. | 55 // via v8::JSON::Parse() and hands off the result to the merchant website. |
56 // There's no one format for this object, so richer types cannot be used. A | 56 // There's no one format for this object, so richer types cannot be used. A |
57 // simple example: | 57 // simple example: |
58 // | 58 // |
59 // {"nameOnCard": "Jon Doe", "pan": "4111 1111 1111 1111"} | 59 // {"nameOnCard": "Jon Doe", "pan": "4111 1111 1111 1111"} |
60 string stringified_details; | 60 string stringified_details; |
61 | 61 |
62 PaymentAddress? shipping_address; | 62 PaymentAddress? shipping_address; |
63 string? shipping_option; | 63 string? shipping_option; |
| 64 string? payer_name; |
64 string? payer_email; | 65 string? payer_email; |
65 string? payer_phone; | 66 string? payer_phone; |
66 }; | 67 }; |
67 | 68 |
68 enum PaymentErrorReason { | 69 enum PaymentErrorReason { |
69 UNKNOWN, | 70 UNKNOWN, |
70 USER_CANCEL, | 71 USER_CANCEL, |
71 NOT_SUPPORTED | 72 NOT_SUPPORTED |
72 }; | 73 }; |
73 | 74 |
(...skipping 25 matching lines...) Expand all Loading... |
99 }; | 100 }; |
100 | 101 |
101 struct PaymentDetails { | 102 struct PaymentDetails { |
102 PaymentItem total; | 103 PaymentItem total; |
103 array<PaymentItem> display_items; | 104 array<PaymentItem> display_items; |
104 array<PaymentShippingOption> shipping_options; | 105 array<PaymentShippingOption> shipping_options; |
105 array<PaymentDetailsModifier> modifiers; | 106 array<PaymentDetailsModifier> modifiers; |
106 }; | 107 }; |
107 | 108 |
108 struct PaymentOptions { | 109 struct PaymentOptions { |
| 110 bool request_payer_name; |
109 bool request_payer_email; | 111 bool request_payer_email; |
110 bool request_payer_phone; | 112 bool request_payer_phone; |
111 bool request_shipping; | 113 bool request_shipping; |
112 }; | 114 }; |
113 | 115 |
114 struct PaymentMethodData { | 116 struct PaymentMethodData { |
115 array<string> supported_methods; | 117 array<string> supported_methods; |
116 // A JSON string built by the renderer from a JavaScript object that the | 118 // A JSON string built by the renderer from a JavaScript object that the |
117 // merchant website provides. The renderer uses | 119 // merchant website provides. The renderer uses |
118 // blink::JSONObject::toJSONString() to generate this string. The browser | 120 // blink::JSONObject::toJSONString() to generate this string. The browser |
(...skipping 15 matching lines...) Expand all Loading... |
134 interface PaymentRequest { | 136 interface PaymentRequest { |
135 Init(PaymentRequestClient client, | 137 Init(PaymentRequestClient client, |
136 array<PaymentMethodData> methodData, | 138 array<PaymentMethodData> methodData, |
137 PaymentDetails details, | 139 PaymentDetails details, |
138 PaymentOptions options); | 140 PaymentOptions options); |
139 Show(); | 141 Show(); |
140 UpdateWith(PaymentDetails details); | 142 UpdateWith(PaymentDetails details); |
141 Abort(); | 143 Abort(); |
142 Complete(PaymentComplete result); | 144 Complete(PaymentComplete result); |
143 }; | 145 }; |
OLD | NEW |