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

Unified Diff: components/payments/core/payment_options_provider.h

Issue 2774233005: Creating PaymentOptionsProvider interface (Closed)
Patch Set: rouslan comments Created 3 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/core/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/payments/core/payment_options_provider.h
diff --git a/components/payments/core/payment_options_provider.h b/components/payments/core/payment_options_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..2421b93de710997599501a166fc464aea344b5d5
--- /dev/null
+++ b/components/payments/core/payment_options_provider.h
@@ -0,0 +1,44 @@
+// Copyright 2017 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.
+
+#ifndef COMPONENTS_PAYMENTS_CORE_PAYMENT_OPTIONS_PROVIDER_H_
+#define COMPONENTS_PAYMENTS_CORE_PAYMENT_OPTIONS_PROVIDER_H_
+
+namespace payments {
+
+// See PaymentOptionsProvider::shipping_type() below.
+enum class PaymentShippingType : int32_t {
+ SHIPPING = 0,
+ DELIVERY = 1,
+ PICKUP = 2,
+};
+
+// An interface which provides immutable values, specified by the merchant at
+// request-time, describing the set of information required from the payer, and
+// possibly the method by which the order will be fulfilled.
+class PaymentOptionsProvider {
+ public:
+ virtual ~PaymentOptionsProvider() {}
+
+ // Returns true if this transaction requires the payer's name.
+ virtual bool request_payer_name() const = 0;
+
+ // Returns true if this transaction requires the payer's email address.
+ virtual bool request_payer_email() const = 0;
+
+ // Returns true if this transaction requires the payer's phone number.
+ virtual bool request_payer_phone() const = 0;
+
+ // Returns true if this transaction requires a shipping address.
+ virtual bool request_shipping() const = 0;
+
+ // A value, provided by the merchant at request-time, indicating the method
+ // by which the order will be fulfilled. Used only to modify presentation of
+ // the user interface, and only meaningful when request_shipping() is true.
+ virtual PaymentShippingType shipping_type() const = 0;
+};
+
+} // namespace payments
+
+#endif // COMPONENTS_PAYMENTS_CORE_PAYMENT_OPTIONS_PROVIDER_H_
« no previous file with comments | « components/payments/core/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698