OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 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 CHROME_BROWSER_AUTOFILL_WALLET_FULL_WALLET_H_ | |
6 #define CHROME_BROWSER_AUTOFILL_WALLET_FULL_WALLET_H_ | |
7 | |
8 #include <string> | |
9 #include <vector> | |
10 | |
11 #include "base/basictypes.h" | |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "chrome/browser/autofill/wallet/wallet_address.h" | |
14 | |
15 namespace base { | |
16 class DictionaryValue; | |
17 } | |
18 | |
19 namespace wallet { | |
20 | |
21 class FullWallet { | |
22 public: | |
23 FullWallet(int expiration_month, | |
24 int expiration_year, | |
25 const std::string& iin, | |
26 const std::string& encrypted_rest, | |
27 Address* billing_address, | |
28 Address* shipping_address, | |
29 const std::vector<std::string> required_actions); | |
30 ~FullWallet(); | |
Dan Beam
2012/11/30 19:55:52
nit: \n before each method with a description
ahutter
2012/12/01 04:06:51
Done.
| |
31 // Returns null if the input invalid, an empty wallet with required actions if | |
32 // there are any, or a valid wallet. The caller owns the returned pointer. | |
33 static FullWallet* CreateFullWallet(base::DictionaryValue* dictionary); | |
34 // Decrypts and returns primary account number (PAN) using generated one time | |
35 // pad (OTP) | |
Dan Beam
2012/11/30 19:55:52
nit: finish comments (even if sentence fragments,
ahutter
2012/12/01 04:06:51
Done.
| |
36 const std::string GetPAN(void* bytes, size_t length); | |
37 // Decrypts and returns card verification number (CVN) using generated one | |
38 // time pad (OTP) | |
39 const std::string GetCVN(void* bytes, size_t length); | |
40 bool operator==(const FullWallet& other) const; | |
41 bool operator!=(const FullWallet& other) const; | |
42 | |
43 const Address* get_billing_address() const { return billing_address_.get(); } | |
44 const Address* get_shipping_address() const { | |
45 return shipping_address_.get(); | |
46 } | |
47 const std::vector<std::string> get_required_actions() const { | |
48 return required_actions_; | |
49 } | |
50 int get_expiration_month() const { return expiration_month_; } | |
51 int get_expiration_year() const { return expiration_year_; } | |
52 | |
53 private: | |
54 void DecryptCardInfo(uint8* otp, size_t length); | |
55 int expiration_month_; | |
Dan Beam
2012/11/30 19:55:52
I assume the compiler will optimize this for us (a
ahutter
2012/12/01 04:06:51
Not sure. +abodenha?
| |
56 int expiration_year_; | |
57 std::string pan_; | |
58 std::string cvn_; | |
59 std::string iin_; | |
60 std::string encrypted_rest_; | |
Dan Beam
2012/11/30 19:55:52
if I were just looking at this file, I'd have no g
ahutter
2012/12/01 04:06:51
Done.
| |
61 scoped_ptr<Address> billing_address_; | |
62 scoped_ptr<Address> shipping_address_; | |
63 std::vector<std::string> required_actions_; | |
64 DISALLOW_COPY_AND_ASSIGN(FullWallet); | |
65 }; | |
66 | |
67 } // end namespace wallet | |
68 | |
69 #endif // CHROME_BROWSER_AUTOFILL_WALLET_FULL_WALLET_H_ | |
OLD | NEW |