Conditions | 1 |
Paths | 1 |
Total Lines | 31 |
Code Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Tests | 16 |
CRAP Score | 1 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php declare(strict_types = 1); |
||
26 | 1 | public function send(ApiClient $apiClient): PaymentResponse |
|
27 | { |
||
28 | $requestData = [ |
||
29 | 1 | 'merchantId' => $this->merchantId, |
|
30 | 1 | 'origPayId' => $this->origPayId, |
|
31 | ]; |
||
32 | |||
33 | 1 | $response = $apiClient->post( |
|
34 | 1 | 'oneclick/echo', |
|
35 | $requestData, |
||
36 | 1 | new SignatureDataFormatter([ |
|
37 | 1 | 'merchantId' => null, |
|
38 | 'origPayId' => null, |
||
39 | 'dttm' => null, |
||
40 | ]), |
||
41 | 1 | new SignatureDataFormatter([ |
|
42 | 1 | 'origPayId' => null, |
|
43 | 'dttm' => null, |
||
44 | 'resultCode' => null, |
||
45 | 'resultMessage' => null, |
||
46 | ]) |
||
47 | ); |
||
48 | |||
49 | 1 | $data = $response->getData(); |
|
50 | |||
51 | 1 | return new PaymentResponse( |
|
52 | 1 | $data['origPayId'], |
|
53 | 1 | DateTimeImmutable::createFromFormat('YmdHis', $data['dttm']), |
|
|
|||
54 | 1 | ResultCode::get($data['resultCode']), |
|
55 | 1 | $data['resultMessage'], |
|
56 | 1 | null |
|
57 | ); |
||
61 |