| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_PAYMENTS_CORE_PAYMENT_INSTRUMENT_H_ | 5 #ifndef COMPONENTS_PAYMENTS_CORE_PAYMENT_INSTRUMENT_H_ |
| 6 #define COMPONENTS_PAYMENTS_CORE_PAYMENT_INSTRUMENT_H_ | 6 #define COMPONENTS_PAYMENTS_CORE_PAYMENT_INSTRUMENT_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 const std::string& stringified_details) = 0; | 30 const std::string& stringified_details) = 0; |
| 31 | 31 |
| 32 virtual void OnInstrumentDetailsError() = 0; | 32 virtual void OnInstrumentDetailsError() = 0; |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 virtual ~PaymentInstrument(); | 35 virtual ~PaymentInstrument(); |
| 36 | 36 |
| 37 // Will call into the |delegate| (can't be null) on success or error. | 37 // Will call into the |delegate| (can't be null) on success or error. |
| 38 virtual void InvokePaymentApp(Delegate* delegate) = 0; | 38 virtual void InvokePaymentApp(Delegate* delegate) = 0; |
| 39 // Returns whether the instrument is complete to be used as a payment method | 39 // Returns whether the instrument is complete to be used as a payment method |
| 40 // without further editing. | 40 // without further editing. If it's not complete, returns false and fills |
| 41 virtual bool IsCompleteForPayment() = 0; | 41 // |missing_info| with the message. NOTE: callers who do not care about the |
| 42 // missing info message can pass nullptr. |
| 43 virtual bool IsCompleteForPayment(base::string16* missing_info) = 0; |
| 42 // Returns whether the instrument is valid for the purposes of responding to | 44 // Returns whether the instrument is valid for the purposes of responding to |
| 43 // canMakePayment. | 45 // canMakePayment. |
| 44 virtual bool IsValidForCanMakePayment() = 0; | 46 virtual bool IsValidForCanMakePayment() = 0; |
| 45 | 47 |
| 46 const std::string& method_name() const { return method_name_; } | 48 const std::string& method_name() const { return method_name_; } |
| 47 const base::string16& label() const { return label_; } | 49 const base::string16& label() const { return label_; } |
| 48 const base::string16& sublabel() const { return sublabel_; } | 50 const base::string16& sublabel() const { return sublabel_; } |
| 49 int icon_resource_id() const { return icon_resource_id_; } | 51 int icon_resource_id() const { return icon_resource_id_; } |
| 50 Type type() { return type_; } | 52 Type type() { return type_; } |
| 51 | 53 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 62 const base::string16 sublabel_; | 64 const base::string16 sublabel_; |
| 63 int icon_resource_id_; | 65 int icon_resource_id_; |
| 64 Type type_; | 66 Type type_; |
| 65 | 67 |
| 66 DISALLOW_COPY_AND_ASSIGN(PaymentInstrument); | 68 DISALLOW_COPY_AND_ASSIGN(PaymentInstrument); |
| 67 }; | 69 }; |
| 68 | 70 |
| 69 } // namespace payments | 71 } // namespace payments |
| 70 | 72 |
| 71 #endif // COMPONENTS_PAYMENTS_CORE_PAYMENT_INSTRUMENT_H_ | 73 #endif // COMPONENTS_PAYMENTS_CORE_PAYMENT_INSTRUMENT_H_ |
| OLD | NEW |