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

Side by Side Diff: components/payments/core/payment_instrument.h

Issue 2733953003: [Payments] Return a basic card response (Closed)
Patch Set: tests 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 unified diff | Download patch
OLDNEW
(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_INSTRUMENT_H_
6 #define COMPONENTS_PAYMENTS_CORE_PAYMENT_INSTRUMENT_H_
7
8 #include <set>
9 #include <string>
10
11 #include "base/macros.h"
12
13 namespace payments {
14
15 // Base class which represents a form of payment in Payment Request.
16 class PaymentInstrument {
17 public:
18 class Delegate {
19 public:
please use gerrit instead 2017/03/08 14:46:10 Need an empty virtual destrutor.
Mathieu 2017/03/08 18:04:26 Done.
20 // Should be called with method name (e.g. "visa"), and json-serialized
please use gerrit instead 2017/03/08 14:46:10 Remove comma before "and". Add comma after "e.g.".
Mathieu 2017/03/08 18:04:26 Done.
21 // stringified details.
22 virtual void OnInstrumentDetailsReady(
23 const std::string& method_name,
24 const std::string& stringified_details) = 0;
25
26 virtual void OnInstrumentDetailsError() = 0;
27 };
28
29 virtual ~PaymentInstrument() {}
30
31 // Will call into the |delegate| (can't be null) on success or error.
32 virtual void InvokePaymentApp(Delegate* delegate) = 0;
33
34 const std::string& method_name() { return method_name_; }
35
36 protected:
37 explicit PaymentInstrument(const std::string& method_name)
38 : method_name_(method_name) {}
39
40 private:
41 const std::string method_name_;
42
43 DISALLOW_COPY_AND_ASSIGN(PaymentInstrument);
44 };
45
46 } // namespace payments
47
48 #endif // COMPONENTS_PAYMENTS_CORE_PAYMENT_INSTRUMENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698