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