1 | <?php |
||
11 | class Authorization implements AuthorizationInterface |
||
12 | { |
||
13 | const PRODUCTION_URI = 'https://api.secure-afterpay.com.au/v1/'; |
||
14 | const SANDBOX_URI = 'https://api-sandbox.secure-afterpay.com.au/v1/'; |
||
15 | |||
16 | /** |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $endpoint; |
||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $merchantId; |
||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $secret; |
||
28 | |||
29 | /** |
||
30 | * Authorization constructor. |
||
31 | * @param string $endpoint |
||
32 | * @param string|null $merchantId |
||
33 | * @param string|null $secret |
||
34 | */ |
||
35 | public function __construct($endpoint, $merchantId = null, $secret = null) |
||
41 | |||
42 | /** |
||
43 | * @return string |
||
44 | */ |
||
45 | public function getEndpoint() |
||
49 | |||
50 | /** |
||
51 | * @param string $endpoint |
||
52 | * @return $this |
||
53 | */ |
||
54 | public function setEndpoint($endpoint) |
||
60 | |||
61 | /** |
||
62 | * @return string |
||
63 | */ |
||
64 | public function getMerchantId() |
||
68 | |||
69 | /** |
||
70 | * @param string $merchantId |
||
71 | * @return $this |
||
72 | */ |
||
73 | public function setMerchantId($merchantId) |
||
79 | |||
80 | /** |
||
81 | * @return string |
||
82 | */ |
||
83 | public function getSecret() |
||
87 | |||
88 | /** |
||
89 | * @param string $secret |
||
90 | * @return $this |
||
91 | */ |
||
92 | public function setSecret($secret) |
||
98 | } |
||
99 |