Conditions | 2 |
Paths | 1 |
Total Lines | 32 |
Code Lines | 23 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php declare(strict_types = 1); |
||
33 | public function send(ApiClient $apiClient): PaymentResponse |
||
34 | { |
||
35 | $requestData = [ |
||
36 | 'merchantId' => $this->merchantId, |
||
37 | 'payId' => $this->payId, |
||
38 | ]; |
||
39 | |||
40 | $response = $apiClient->post( |
||
41 | 'oneclick/start', |
||
42 | $requestData, |
||
43 | new SignatureDataFormatter([ |
||
44 | 'merchantId' => null, |
||
45 | 'payId' => null, |
||
46 | 'dttm' => null, |
||
47 | ]), |
||
48 | new SignatureDataFormatter([ |
||
49 | 'payId' => null, |
||
50 | 'dttm' => null, |
||
51 | 'resultCode' => null, |
||
52 | 'resultMessage' => null, |
||
53 | 'paymentStatus' => null, |
||
54 | ]) |
||
55 | ); |
||
56 | |||
57 | $data = $response->getData(); |
||
58 | |||
59 | return new PaymentResponse( |
||
60 | $data['payId'], |
||
61 | DateTimeImmutable::createFromFormat('YmdHis', $data['dttm']), |
||
|
|||
62 | ResultCode::get($data['resultCode']), |
||
63 | $data['resultMessage'], |
||
64 | isset($data['paymentStatus']) ? PaymentStatus::get($data['paymentStatus']) : null |
||
65 | ); |
||
69 |