OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 module payments.mojom; | |
6 | |
7 struct ShippingAddress { | |
8 string region_code; | |
9 array<string> address_line; | |
10 string administrative_area; | |
11 string locality; | |
12 string dependent_locality; | |
13 string postal_code; | |
14 string sorting_code; | |
15 string language_code; | |
16 string organization; | |
17 string recipient; | |
18 }; | |
19 | |
20 struct PaymentResponse { | |
21 string method_name; | |
22 string stringified_details; | |
palmer
2016/03/08 22:49:36
This is vague and weakly-typed. Can you document w
please use gerrit instead
2016/03/10 00:38:05
I've documented stringified_details and stringifie
| |
23 }; | |
24 | |
25 interface PaymentRequestClient { | |
26 OnShippingAddressChange(ShippingAddress address); | |
27 OnShippingOptionChange(string shipping_option_id); | |
28 OnPaymentResponse(PaymentResponse response); | |
29 OnError(); | |
30 OnComplete(); | |
31 }; | |
32 | |
33 struct CurrencyAmount { | |
34 string currency_code; | |
palmer
2016/03/08 22:49:36
currency_code, region_code, language_code, et c. f
please use gerrit instead
2016/03/10 00:38:05
Done.
haavardm
2016/03/10 12:46:57
I'm skeptical about enuming any of the input from
| |
35 string value; | |
palmer
2016/03/08 22:49:36
Hmm, a string for money feels odd. Why not use a t
please use gerrit instead
2016/03/10 00:38:05
Done.
haavardm
2016/03/10 12:46:57
The payment request api defines it as string, so I
| |
36 }; | |
37 | |
38 struct PaymentItem { | |
39 string id; | |
40 string label; | |
41 CurrencyAmount amount; | |
42 }; | |
43 | |
44 struct ShippingOption { | |
45 string id; | |
46 string label; | |
47 CurrencyAmount amount; | |
48 }; | |
49 | |
50 struct PaymentDetails { | |
51 array<PaymentItem> items; | |
52 array<ShippingOption> shipping_options; | |
53 }; | |
54 | |
55 struct PaymentOptions { | |
56 bool request_shipping; | |
57 }; | |
58 | |
59 interface PaymentRequest { | |
60 SetClient(PaymentRequestClient client); | |
61 Show(array<string> supported_methods, | |
62 PaymentDetails details, | |
63 PaymentOptions options, | |
64 string stringified_data); | |
65 Abort(); | |
66 Complete(bool success); | |
67 }; | |
OLD | NEW |