Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Unified Diff: components/payments/payment_request.mojom

Issue 1753543002: PaymentRequest Mojo bindings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@interface
Patch Set: Rename WebStuff into PlatformStuff Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/payments/OWNERS ('k') | third_party/WebKit/LayoutTests/payments/payment-request-interface.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+};
« no previous file with comments | « components/payments/OWNERS ('k') | third_party/WebKit/LayoutTests/payments/payment-request-interface.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698