Chromium Code Reviews| 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(); | |
| 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 PAN using generated OTP | |
|
Albert Bodenhamer
2012/11/28 23:50:56
What does PAN stand for?
ahutter
2012/11/29 20:52:38
Done.
| |
| 35 const std::string GetPAN(void* bytes, size_t length); | |
| 36 // Decrypts and returns CVN using generated OTP | |
| 37 const std::string GetCVN(void* bytes, size_t length); | |
|
Albert Bodenhamer
2012/11/28 23:50:56
Ditto CVN. Keep in mind not all Chrome contributo
ahutter
2012/11/29 20:52:38
Done.
| |
| 38 bool operator==(const FullWallet& other) const; | |
| 39 bool operator!=(const FullWallet& other) const; | |
| 40 | |
| 41 const Address* get_billing_address() const { return billing_address_.get(); } | |
| 42 const Address* get_shipping_address() const { | |
| 43 return shipping_address_.get(); | |
| 44 } | |
| 45 const std::vector<std::string> get_required_actions() const { | |
| 46 return required_actions_; | |
| 47 } | |
| 48 int get_expiration_month() const { return expiration_month_; } | |
| 49 int get_expiration_year() const { return expiration_year_; } | |
| 50 | |
| 51 private: | |
| 52 void DecryptCardInfo(uint8* otp, size_t length); | |
| 53 int expiration_month_; | |
| 54 int expiration_year_; | |
| 55 std::string pan_; | |
| 56 std::string cvn_; | |
| 57 std::string iin_; | |
| 58 std::string encrypted_rest_; | |
| 59 scoped_ptr<Address> billing_address_; | |
| 60 scoped_ptr<Address> shipping_address_; | |
| 61 std::vector<std::string> required_actions_; | |
| 62 DISALLOW_COPY_AND_ASSIGN(FullWallet); | |
| 63 }; | |
| 64 | |
| 65 } // end namespace wallet | |
| 66 | |
| 67 #endif // CHROME_BROWSER_AUTOFILL_WALLET_FULL_WALLET_H_ | |
| OLD | NEW |