1 | <?php |
||
7 | class Config |
||
8 | { |
||
9 | /** |
||
10 | * Allegro WebAPI key |
||
11 | * @var string |
||
12 | */ |
||
13 | protected $apiKey = null; |
||
14 | |||
15 | /** |
||
16 | * Allegro login |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $login = null; |
||
20 | |||
21 | /** |
||
22 | * Allegro password hash (base64 of sha-256 of plaintext password) |
||
23 | * @var string |
||
24 | */ |
||
25 | protected $passwordHash = null; |
||
26 | |||
27 | /** |
||
28 | * Whether to use sandbox |
||
29 | * @var boolean |
||
30 | */ |
||
31 | protected $isSandbox = null; |
||
32 | |||
33 | /** |
||
34 | * @var string country code required by WebAPI for certain operations |
||
35 | */ |
||
36 | /** |
||
37 | * [$countryCode description] |
||
38 | * @var [type] |
||
39 | */ |
||
40 | protected $countryCode = null; |
||
41 | |||
42 | /** |
||
43 | * Plain text password |
||
44 | * Useful for those moments when sandbox refuses to work with hashed password |
||
45 | * ("wrong username or password" exception despite using correct credentials). |
||
46 | * It is not recommended to use it otherwise, always keep hashed, not plaintext |
||
47 | * password in your config for safety reasons. |
||
48 | * @var string |
||
49 | */ |
||
50 | protected $passwordPlain = null; |
||
51 | |||
52 | |||
53 | 13 | public function __construct(array $params) |
|
65 | |||
66 | |||
67 | 7 | public function getApiKey() |
|
71 | |||
72 | |||
73 | 8 | public function getLogin() |
|
77 | |||
78 | |||
79 | 8 | public function getPasswordHash() |
|
83 | |||
84 | |||
85 | 1 | public function getIsSandbox() |
|
89 | |||
90 | |||
91 | 8 | public function getCountryCode() |
|
95 | |||
96 | |||
97 | 3 | public function getPasswordPlain() |
|
101 | |||
102 | |||
103 | 2 | public function setPasswordPlain($passwordPlain) |
|
107 | |||
108 | |||
109 | } |
||
110 |