Chromium Code Reviews| Index: components/payments/payment_request.mojom |
| diff --git a/components/payments/payment_request.mojom b/components/payments/payment_request.mojom |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2332490db9ae7d58371695876f0e61ac92800121 |
| --- /dev/null |
| +++ b/components/payments/payment_request.mojom |
| @@ -0,0 +1,67 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +module payments.mojom; |
| + |
| +struct ShippingAddress { |
| + string region_code; |
| + array<string> address_line; |
| + string administrative_area; |
| + string locality; |
| + string dependent_locality; |
| + string postal_code; |
| + string sorting_code; |
| + string language_code; |
| + string organization; |
| + string recipient; |
| +}; |
| + |
| +struct PaymentResponse { |
| + string method_name; |
| + 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
|
| +}; |
| + |
| +interface PaymentRequestClient { |
| + OnShippingAddressChange(ShippingAddress address); |
| + OnShippingOptionChange(string shipping_option_id); |
| + OnPaymentResponse(PaymentResponse response); |
| + OnError(); |
| + OnComplete(); |
| +}; |
| + |
| +struct CurrencyAmount { |
| + 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
|
| + 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
|
| +}; |
| + |
| +struct PaymentItem { |
| + string id; |
| + string label; |
| + CurrencyAmount amount; |
| +}; |
| + |
| +struct ShippingOption { |
| + string id; |
| + string label; |
| + CurrencyAmount amount; |
| +}; |
| + |
| +struct PaymentDetails { |
| + array<PaymentItem> items; |
| + array<ShippingOption> shipping_options; |
| +}; |
| + |
| +struct PaymentOptions { |
| + bool request_shipping; |
| +}; |
| + |
| +interface PaymentRequest { |
| + SetClient(PaymentRequestClient client); |
| + Show(array<string> supported_methods, |
| + PaymentDetails details, |
| + PaymentOptions options, |
| + string stringified_data); |
| + Abort(); |
| + Complete(bool success); |
| +}; |