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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 // | 56 // |
57 // {"nameOnCard": "Jon Doe", "pan": "4111 1111 1111 1111"} | 57 // {"nameOnCard": "Jon Doe", "pan": "4111 1111 1111 1111"} |
58 string stringified_details; | 58 string stringified_details; |
59 | 59 |
60 PaymentAddress? shipping_address; | 60 PaymentAddress? shipping_address; |
61 string? shipping_option; | 61 string? shipping_option; |
62 string? payer_email; | 62 string? payer_email; |
63 string? payer_phone; | 63 string? payer_phone; |
64 }; | 64 }; |
65 | 65 |
| 66 enum PaymentErrorReason { |
| 67 UNKNOWN, |
| 68 USER_CANCEL, |
| 69 NOT_SUPPORTED |
| 70 }; |
| 71 |
66 interface PaymentRequestClient { | 72 interface PaymentRequestClient { |
67 OnShippingAddressChange(PaymentAddress address); | 73 OnShippingAddressChange(PaymentAddress address); |
68 OnShippingOptionChange(string shipping_option_id); | 74 OnShippingOptionChange(string shipping_option_id); |
69 OnPaymentResponse(PaymentResponse response); | 75 OnPaymentResponse(PaymentResponse response); |
70 OnError(); | 76 OnError(PaymentErrorReason error); |
71 OnComplete(); | 77 OnComplete(); |
72 OnAbort(bool aborted_successfully); | 78 OnAbort(bool aborted_successfully); |
73 }; | 79 }; |
74 | 80 |
75 struct PaymentItem { | 81 struct PaymentItem { |
76 string label; | 82 string label; |
77 PaymentCurrencyAmount amount; | 83 PaymentCurrencyAmount amount; |
78 }; | 84 }; |
79 | 85 |
80 struct PaymentShippingOption { | 86 struct PaymentShippingOption { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 | 131 |
126 interface PaymentRequest { | 132 interface PaymentRequest { |
127 SetClient(PaymentRequestClient client); | 133 SetClient(PaymentRequestClient client); |
128 Show(array<PaymentMethodData> methodData, | 134 Show(array<PaymentMethodData> methodData, |
129 PaymentDetails details, | 135 PaymentDetails details, |
130 PaymentOptions options); | 136 PaymentOptions options); |
131 UpdateWith(PaymentDetails details); | 137 UpdateWith(PaymentDetails details); |
132 Abort(); | 138 Abort(); |
133 Complete(PaymentComplete result); | 139 Complete(PaymentComplete result); |
134 }; | 140 }; |
OLD | NEW |