1 | <?php |
||
8 | class Api |
||
9 | { |
||
10 | /** |
||
11 | * @var \Payum\Core\HttpClientInterface |
||
12 | */ |
||
13 | protected $client; |
||
14 | |||
15 | /** |
||
16 | * @var \Http\Message\MessageFactory |
||
17 | */ |
||
18 | protected $messageFactory; |
||
19 | |||
20 | /** |
||
21 | * @var array |
||
22 | */ |
||
23 | protected $options = []; |
||
24 | |||
25 | /** |
||
26 | * @var array |
||
27 | */ |
||
28 | protected $heads = [ |
||
29 | 'Version', |
||
30 | 'MerCode', |
||
31 | 'MerName', |
||
32 | 'Account', |
||
33 | 'MsgId', |
||
34 | 'ReqDate', |
||
35 | 'Signature', |
||
36 | 'ReferenceID', |
||
37 | 'RspCode', |
||
38 | 'RspMsg', |
||
39 | 'RspDate', |
||
40 | ]; |
||
41 | |||
42 | /** |
||
43 | * @var array |
||
44 | */ |
||
45 | protected $cdata = [ |
||
46 | 'Merchanturl', |
||
47 | 'FailUrl', |
||
48 | 'ServerUrl', |
||
49 | 'GoodsName', |
||
50 | 'MsgId', |
||
51 | 'RspMsg', |
||
52 | 'Msg', |
||
53 | ]; |
||
54 | |||
55 | /** |
||
56 | * @param array $options |
||
57 | * @param \Payum\Core\HttpClientInterface $client |
||
58 | * @param \Http\Message\MessageFactory $messageFactory |
||
59 | * |
||
60 | * @throws \Payum\Core\Exception\InvalidArgumentException if an option is invalid |
||
61 | */ |
||
62 | 4 | public function __construct(array $options, HttpClientInterface $client, MessageFactory $messageFactory) |
|
68 | |||
69 | /** |
||
70 | * getApiEndpoint. |
||
71 | * |
||
72 | * @return string |
||
73 | */ |
||
74 | public function getApiEndpoint($type = 'capture') |
||
86 | |||
87 | /** |
||
88 | * createTransaction. |
||
89 | * |
||
90 | * @param array $params |
||
91 | * @return array |
||
92 | */ |
||
93 | 1 | public function createTransaction(array $params) |
|
145 | |||
146 | /** |
||
147 | * getTransactionData. |
||
148 | * |
||
149 | * @param mixed $params |
||
150 | * @return array |
||
151 | */ |
||
152 | public function getTransactionData(array $params) |
||
156 | |||
157 | /** |
||
158 | * Verify if the hash of the given parameter is correct. |
||
159 | * |
||
160 | * @param array $params |
||
161 | * @return bool |
||
162 | */ |
||
163 | public function verifyHash(array $params) |
||
167 | |||
168 | /** |
||
169 | * parseResponse. |
||
170 | * |
||
171 | * @param string $response |
||
172 | * @return string |
||
173 | */ |
||
174 | 2 | public function parseResponse($response) |
|
187 | |||
188 | /** |
||
189 | * generatGetwayRequest. |
||
190 | * |
||
191 | * @param array $params |
||
192 | * @return string |
||
193 | */ |
||
194 | 2 | protected function generatGetwayRequest($params) |
|
205 | |||
206 | /** |
||
207 | * convertToXML. |
||
208 | * |
||
209 | * @param array $params |
||
210 | * @return string |
||
211 | */ |
||
212 | 2 | protected function convertToXML($params) |
|
225 | |||
226 | /** |
||
227 | * split. |
||
228 | * |
||
229 | * @param array $params |
||
230 | * @return array |
||
231 | */ |
||
232 | 2 | protected function split($params) |
|
247 | |||
248 | /** |
||
249 | * addCdata. |
||
250 | * |
||
251 | * @param array $params |
||
252 | * @return array |
||
253 | */ |
||
254 | 2 | protected function addCdata($params) |
|
264 | |||
265 | /** |
||
266 | * calculateHash. |
||
267 | * |
||
268 | * @param array $params |
||
269 | * @return string |
||
270 | */ |
||
271 | 2 | protected function calculateHash(array $params) |
|
282 | |||
283 | /** |
||
284 | * parseResultTags. |
||
285 | * |
||
286 | * @param string $paymentResult |
||
287 | * @return array |
||
288 | */ |
||
289 | 2 | protected function parseResultTags($paymentResult) |
|
298 | |||
299 | /** |
||
300 | * isSandbox. |
||
301 | * |
||
302 | * @return bool |
||
303 | */ |
||
304 | 1 | public function isSandbox() |
|
308 | |||
309 | /** |
||
310 | * generateTestingResponse. |
||
311 | * |
||
312 | * @param array $params |
||
313 | * @return array |
||
314 | */ |
||
315 | 1 | public function generateTestingResponse($params = []) |
|
345 | } |
||
346 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.