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