Conditions | 4 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
14 | 3 | private function parsePaystackResponse() |
|
15 | { |
||
16 | 3 | $resp = \json_decode($this->body); |
|
17 | |||
18 | 3 | if (json_last_error() !== JSON_ERROR_NONE || !$resp->status) { |
|
19 | 2 | throw new ApiException( |
|
20 | "Paystack Request failed with response: '" . |
||
21 | 2 | ((json_last_error() === JSON_ERROR_NONE) ? $resp->message : $this->body) . "'." |
|
22 | 2 | ); |
|
23 | } |
||
24 | |||
25 | 1 | return $resp; |
|
26 | } |
||
27 | |||
48 |