| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 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 #ifndef COMPONENTS_PAYMENTS_CORE_PAYMENT_OPTIONS_PROVIDER_H_ |
| 6 #define COMPONENTS_PAYMENTS_CORE_PAYMENT_OPTIONS_PROVIDER_H_ |
| 7 |
| 8 namespace payments { |
| 9 |
| 10 // See PaymentOptionsProvider::shipping_type() below. |
| 11 enum class PaymentShippingType : int32_t { |
| 12 SHIPPING = 0, |
| 13 DELIVERY = 1, |
| 14 PICKUP = 2, |
| 15 }; |
| 16 |
| 17 // An interface which provides immutable values, specified by the merchant at |
| 18 // request-time, describing the set of information required from the payer, and |
| 19 // possibly the method by which the order will be fulfilled. |
| 20 class PaymentOptionsProvider { |
| 21 public: |
| 22 virtual ~PaymentOptionsProvider() {} |
| 23 |
| 24 // Returns true if this transaction requires the payer's name. |
| 25 virtual bool request_payer_name() const = 0; |
| 26 |
| 27 // Returns true if this transaction requires the payer's email address. |
| 28 virtual bool request_payer_email() const = 0; |
| 29 |
| 30 // Returns true if this transaction requires the payer's phone number. |
| 31 virtual bool request_payer_phone() const = 0; |
| 32 |
| 33 // Returns true if this transaction requires a shipping address. |
| 34 virtual bool request_shipping() const = 0; |
| 35 |
| 36 // A value, provided by the merchant at request-time, indicating the method |
| 37 // by which the order will be fulfilled. Used only to modify presentation of |
| 38 // the user interface, and only meaningful when request_shipping() is true. |
| 39 virtual PaymentShippingType shipping_type() const = 0; |
| 40 }; |
| 41 |
| 42 } // namespace payments |
| 43 |
| 44 #endif // COMPONENTS_PAYMENTS_CORE_PAYMENT_OPTIONS_PROVIDER_H_ |
| OLD | NEW |