1 | <?php |
||
14 | abstract class AbstractRequest extends BaseAbstractRequest |
||
15 | { |
||
16 | /** |
||
17 | * Live Endpoint URL. |
||
18 | * |
||
19 | * @var string URL |
||
20 | */ |
||
21 | protected $liveEndpoint = 'https://gateway.acquiropay.com'; |
||
22 | |||
23 | /** |
||
24 | * Test Endpoint URL. |
||
25 | * |
||
26 | * @var string URL |
||
27 | */ |
||
28 | protected $testEndpoint = 'https://gateway.acqp.co'; |
||
29 | |||
30 | /** |
||
31 | * Get merchant id. |
||
32 | * |
||
33 | * @return string|null |
||
34 | */ |
||
35 | 92 | public function getMerchantId() |
|
39 | |||
40 | /** |
||
41 | * Set merchant id. |
||
42 | * |
||
43 | * @param string $value |
||
44 | * |
||
45 | * @throws RuntimeException |
||
46 | * |
||
47 | * @return BaseAbstractRequest|AbstractRequest |
||
48 | */ |
||
49 | 66 | public function setMerchantId($value) |
|
53 | |||
54 | /** |
||
55 | * Get product id. |
||
56 | * |
||
57 | * @return string|null |
||
58 | */ |
||
59 | 50 | public function getProductId() |
|
63 | |||
64 | /** |
||
65 | * Set product id. |
||
66 | * |
||
67 | * @param string $value |
||
68 | * |
||
69 | * @throws RuntimeException |
||
70 | * |
||
71 | * @return BaseAbstractRequest|AbstractRequest |
||
72 | */ |
||
73 | 54 | public function setProductId($value) |
|
77 | |||
78 | /** |
||
79 | * Get a secret word. |
||
80 | * |
||
81 | * @return string|null |
||
82 | */ |
||
83 | 92 | public function getSecretWord() |
|
87 | |||
88 | /** |
||
89 | * Set product secret word. |
||
90 | * |
||
91 | * @param string $value |
||
92 | * |
||
93 | * @throws RuntimeException |
||
94 | * |
||
95 | * @return BaseAbstractRequest |
||
96 | */ |
||
97 | 66 | public function setSecretWord($value) |
|
101 | |||
102 | /** |
||
103 | * Send the request with specified data. |
||
104 | * |
||
105 | * @param mixed $data The data to send |
||
106 | * |
||
107 | * @return ResponseInterface |
||
108 | */ |
||
109 | 30 | public function sendData($data) |
|
130 | |||
131 | /** |
||
132 | * Get endpoint. |
||
133 | * |
||
134 | * @return string |
||
135 | */ |
||
136 | 30 | protected function getEndpoint() |
|
140 | |||
141 | /** |
||
142 | * Create response. |
||
143 | * |
||
144 | * @param $data |
||
145 | * |
||
146 | * @return Response |
||
147 | */ |
||
148 | 30 | protected function createResponse($data) |
|
152 | |||
153 | /** |
||
154 | * Get a request token. |
||
155 | * |
||
156 | * @return string |
||
157 | */ |
||
158 | abstract public function getRequestToken(); |
||
159 | } |
||
160 |