1 | <?php |
||
11 | class Authorization implements AuthorizationInterface |
||
12 | { |
||
13 | const PRODUCTION_URI = 'https://api.secure-afterpay.com.au/v1/'; |
||
14 | const PRODUCTION_BASE_URI = 'https://api.secure-afterpay.com.au'; |
||
15 | const SANDBOX_URI = 'https://api-sandbox.secure-afterpay.com.au/v1/'; |
||
16 | const SANDBOX_BASE_URL = 'https://api-sandbox.secure-afterpay.com.au'; |
||
17 | |||
18 | /** |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $endpoint; |
||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | protected $merchantId; |
||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $secret; |
||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | protected $user_agent; |
||
34 | |||
35 | /** |
||
36 | * Authorization constructor. |
||
37 | * @param string $endpoint |
||
38 | * @param string|null $merchantId |
||
39 | * @param string|null $secret |
||
40 | */ |
||
41 | public function __construct($endpoint, $merchantId = null, $secret = null) |
||
47 | |||
48 | /** |
||
49 | * @return string |
||
50 | */ |
||
51 | public function getEndpoint() |
||
55 | |||
56 | /** |
||
57 | * @param string $endpoint |
||
58 | * @return $this |
||
59 | */ |
||
60 | public function setEndpoint($endpoint) |
||
66 | |||
67 | /** |
||
68 | * @return string |
||
69 | */ |
||
70 | public function getMerchantId() |
||
74 | |||
75 | /** |
||
76 | * @param string $merchantId |
||
77 | * @return $this |
||
78 | */ |
||
79 | public function setMerchantId($merchantId) |
||
85 | |||
86 | /** |
||
87 | * @return string |
||
88 | */ |
||
89 | public function getSecret() |
||
93 | |||
94 | /** |
||
95 | * @param string $secret |
||
96 | * @return $this |
||
97 | */ |
||
98 | public function setSecret($secret) |
||
104 | |||
105 | |||
106 | /** |
||
107 | * @param string $user_agent |
||
108 | * @return $this |
||
109 | */ |
||
110 | public function setUserAgent($user_agent) |
||
116 | /** |
||
117 | * @return string |
||
118 | */ |
||
119 | public function getUserAgent() |
||
123 | } |
||
124 | |||
125 |