| Conditions | 1 |
| Paths | 1 |
| Total Lines | 24 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types = 1); |
||
| 20 | 1 | public function send(ApiClient $apiClient): EchoResponse |
|
| 21 | { |
||
| 22 | 1 | $response = $apiClient->get( |
|
| 23 | 1 | 'echo/{merchantId}/{dttm}/{signature}', |
|
| 24 | [ |
||
| 25 | 1 | 'merchantId' => $this->merchantId, |
|
| 26 | ], |
||
| 27 | 1 | new SignatureDataFormatter([ |
|
| 28 | 1 | 'merchantId' => null, |
|
| 29 | 'dttm' => null, |
||
| 30 | ]), |
||
| 31 | 1 | new SignatureDataFormatter([ |
|
| 32 | 1 | 'dttm' => null, |
|
| 33 | 'resultCode' => null, |
||
| 34 | 'resultMessage' => null, |
||
| 35 | ]) |
||
| 36 | ); |
||
| 37 | |||
| 38 | 1 | $data = $response->getData(); |
|
| 39 | |||
| 40 | 1 | return new EchoResponse( |
|
| 41 | 1 | DateTimeImmutable::createFromFormat('YmdHis', $data['dttm']), |
|
|
|
|||
| 42 | 1 | ResultCode::get($data['resultCode']), |
|
| 43 | 1 | $data['resultMessage'] |
|
| 44 | ); |
||
| 48 |