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

Side by Side Diff: chrome/browser/autofill/wallet/full_wallet.h

Issue 11293078: Integrating Online Wallet into Chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More fixes from code review Created 8 years 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 | Annotate | Revision Log
OLDNEW
(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 // FullWallet contains all the information a merchant requires from a user for
22 // that user to make a purchase.
23 class FullWallet {
24 public:
25 FullWallet(int expiration_month,
Albert Bodenhamer 2012/12/05 18:56:45 It looks like CreateFullWallet is the correct way
ahutter 2012/12/05 23:37:23 Public for unit testing. Added a comment.
26 int expiration_year,
27 const std::string& iin,
28 const std::string& encrypted_rest,
29 Address* billing_address,
30 Address* shipping_address,
31 const std::vector<std::string> required_actions);
32 ~FullWallet();
33
34 // Returns null if the input invalid, an empty wallet with required actions if
35 // there are any, or a valid wallet. The caller owns the returned pointer.
36 static FullWallet* CreateFullWallet(const base::DictionaryValue& dictionary);
37
38 // Decrypts and returns primary account number (PAN) using generated one time
39 // pad (OTP).
40 const std::string GetPan(void* bytes, size_t length);
41
42 // Decrypts and returns card verification number (CVN) using generated one
43 // time pad (OTP).
44 const std::string GetCvn(void* bytes, size_t length);
45
46 bool operator==(const FullWallet& other) const;
47 bool operator!=(const FullWallet& other) const;
48
49 const Address* billing_address() const { return billing_address_.get(); }
50 const Address* shipping_address() const { return shipping_address_.get(); }
51 const std::vector<std::string> required_actions() const {
52 return required_actions_;
53 }
54 int expiration_month() const { return expiration_month_; }
55 int expiration_year() const { return expiration_year_; }
56
57 private:
58 void DecryptCardInfo(uint8* otp, size_t length);
59 int expiration_month_;
60 int expiration_year_;
61 // Primary account number (PAN)
62 std::string pan_;
63 // Card verification number (CVN)
64 std::string cvn_;
65 // Issuer identification number (IIN)
66 std::string iin_;
67 // Encrypted concatentation of CVN and PAN without IIN
68 std::string encrypted_rest_;
69 scoped_ptr<Address> billing_address_;
70 scoped_ptr<Address> shipping_address_;
71 std::vector<std::string> required_actions_;
72 DISALLOW_COPY_AND_ASSIGN(FullWallet);
73 };
74
75 } // end namespace wallet
76
77 #endif // CHROME_BROWSER_AUTOFILL_WALLET_FULL_WALLET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698