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