| Conditions | 2 |
| Paths | 5 |
| Total Lines | 25 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 68 | public function status(): object |
||
| 69 | { |
||
| 70 | $data = (object)null; |
||
| 71 | |||
| 72 | try { |
||
| 73 | $client = new Client($this->clientConfig); |
||
| 74 | |||
| 75 | $response = $client->post($this->endpoint . "checkouts/{$this->getCheckoutId()}/payment?entityId=" . config('sibs.authentication.entityId'), |
||
| 76 | [ |
||
| 77 | 'headers' => [ |
||
| 78 | 'Authorization' => config('sibs.authentication.token'), |
||
| 79 | ], |
||
| 80 | ]); |
||
| 81 | |||
| 82 | $data->status = $response->getStatusCode(); |
||
| 83 | $data->response = json_decode($response->getBody()->getContents()); |
||
| 84 | |||
| 85 | return $data; |
||
| 86 | } catch (ClientException $e) { |
||
| 87 | $response = $e->getResponse(); |
||
| 88 | |||
| 89 | $data->status = $response->getStatusCode(); |
||
| 90 | $data->response = json_decode($response->getBody()->getContents()); |
||
| 91 | |||
| 92 | return $data; |
||
| 93 | } |
||
| 96 |