OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_AUTOFILL_BROWSER_WALLET_FULL_WALLET_H_ | 5 #ifndef COMPONENTS_AUTOFILL_BROWSER_WALLET_FULL_WALLET_H_ |
6 #define COMPONENTS_AUTOFILL_BROWSER_WALLET_FULL_WALLET_H_ | 6 #define COMPONENTS_AUTOFILL_BROWSER_WALLET_FULL_WALLET_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... | |
38 CreateFullWallet(const base::DictionaryValue& dictionary); | 38 CreateFullWallet(const base::DictionaryValue& dictionary); |
39 | 39 |
40 // Decrypts and returns the primary account number (PAN) using the generated | 40 // Decrypts and returns the primary account number (PAN) using the generated |
41 // one time pad, |one_time_pad_|. | 41 // one time pad, |one_time_pad_|. |
42 const std::string& GetPan(); | 42 const std::string& GetPan(); |
43 | 43 |
44 // Decrypts and returns the card verification number (CVN) using the generated | 44 // Decrypts and returns the card verification number (CVN) using the generated |
45 // one time pad, |one_time_pad_|. | 45 // one time pad, |one_time_pad_|. |
46 const std::string& GetCvn(); | 46 const std::string& GetCvn(); |
47 | 47 |
48 // Returns corresponding data for |type|. |is_billing| is used to determine | |
49 // which address to use when |type| is an ADDRESS_HOME_* AutofillFieldType. | |
50 string16 GetInfo(AutofillFieldType type, bool is_billing); | |
Evan Stade
2013/03/14 02:39:38
leave this file alone, do it all in data model wra
Dan Beam
2013/03/14 04:31:51
we talked about this -- the stuff that has to do w
| |
51 | |
48 // Whether or not |action| is in |required_actions_|. | 52 // Whether or not |action| is in |required_actions_|. |
49 bool HasRequiredAction(RequiredAction action) const; | 53 bool HasRequiredAction(RequiredAction action) const; |
50 | 54 |
51 bool operator==(const FullWallet& other) const; | 55 bool operator==(const FullWallet& other) const; |
52 bool operator!=(const FullWallet& other) const; | 56 bool operator!=(const FullWallet& other) const; |
53 | 57 |
54 // If there are required actions |billing_address_| might contain NULL. | 58 // If there are required actions |billing_address_| might contain NULL. |
55 const Address* billing_address() const { return billing_address_.get(); } | 59 const Address* billing_address() const { return billing_address_.get(); } |
56 | 60 |
57 // If there are required actions or shipping address is not required | 61 // If there are required actions or shipping address is not required |
(...skipping 14 matching lines...) Expand all Loading... | |
72 friend class FullWalletTest; | 76 friend class FullWalletTest; |
73 FRIEND_TEST_ALL_PREFIXES(FullWalletTest, CreateFullWallet); | 77 FRIEND_TEST_ALL_PREFIXES(FullWalletTest, CreateFullWallet); |
74 FRIEND_TEST_ALL_PREFIXES(FullWalletTest, CreateFullWalletWithRequiredActions); | 78 FRIEND_TEST_ALL_PREFIXES(FullWalletTest, CreateFullWalletWithRequiredActions); |
75 FullWallet(int expiration_month, | 79 FullWallet(int expiration_month, |
76 int expiration_year, | 80 int expiration_year, |
77 const std::string& iin, | 81 const std::string& iin, |
78 const std::string& encrypted_rest, | 82 const std::string& encrypted_rest, |
79 scoped_ptr<Address> billing_address, | 83 scoped_ptr<Address> billing_address, |
80 scoped_ptr<Address> shipping_address, | 84 scoped_ptr<Address> shipping_address, |
81 const std::vector<RequiredAction>& required_actions); | 85 const std::vector<RequiredAction>& required_actions); |
86 | |
87 // Decrypts both |pan_| and |cvn_|. | |
82 void DecryptCardInfo(); | 88 void DecryptCardInfo(); |
83 | 89 |
90 // Returns either the billing or shipping address based on |is_billing|. | |
91 const Address* GetAddress(bool is_billing) const; | |
92 | |
84 // The expiration month of the proxy card. It should be 1-12. | 93 // The expiration month of the proxy card. It should be 1-12. |
85 int expiration_month_; | 94 int expiration_month_; |
86 | 95 |
87 // The expiration year of the proxy card. It should be a 4-digit year. | 96 // The expiration year of the proxy card. It should be a 4-digit year. |
88 int expiration_year_; | 97 int expiration_year_; |
89 | 98 |
90 // Primary account number (PAN). Its format is \d{16}. | 99 // Primary account number (PAN). Its format is \d{16}. |
91 std::string pan_; | 100 std::string pan_; |
92 | 101 |
93 // Card verification number (CVN). Its format is \d{3}. | 102 // Card verification number (CVN). Its format is \d{3}. |
(...skipping 18 matching lines...) Expand all Loading... | |
112 // The one time pad used for FullWallet encryption. | 121 // The one time pad used for FullWallet encryption. |
113 std::vector<uint8> one_time_pad_; | 122 std::vector<uint8> one_time_pad_; |
114 | 123 |
115 DISALLOW_COPY_AND_ASSIGN(FullWallet); | 124 DISALLOW_COPY_AND_ASSIGN(FullWallet); |
116 }; | 125 }; |
117 | 126 |
118 } // namespace wallet | 127 } // namespace wallet |
119 } // namespace autofill | 128 } // namespace autofill |
120 | 129 |
121 #endif // COMPONENTS_AUTOFILL_BROWSER_WALLET_FULL_WALLET_H_ | 130 #endif // COMPONENTS_AUTOFILL_BROWSER_WALLET_FULL_WALLET_H_ |
OLD | NEW |