From 084e85cef0ac71f5d47349705081c6266457de29 Mon Sep 17 00:00:00 2001 From: Hammed Osanyinpeju Date: Wed, 24 Jul 2019 17:03:23 +0100 Subject: [PATCH 1/2] Fix to ApiException on line 659 of Paystack.php --- Paystack.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Paystack.php b/Paystack.php index b0ac22e..5a30a7c 100644 --- a/Paystack.php +++ b/Paystack.php @@ -656,7 +656,7 @@ private function parsePaystackPaystackHttpResponse() $resp = \json_decode($this->body); if ($resp === null || !property_exists($resp, 'status') || !$resp->status) { - throw new ApiException( + throw new PaystackExceptionApiException( "Paystack Request failed with Response: '" . $this->messageFromApiJson($resp)."'", $resp From 96b9349b8f35ea9d68dc1de647bb5c6dc1b1ae64 Mon Sep 17 00:00:00 2001 From: Hammed Olalekan Osanyinpeju <41470011+successtar@users.noreply.github.com> Date: Sat, 31 Aug 2019 07:27:17 +0100 Subject: [PATCH 2/2] Return response data for invalid transaction id and connection failure without throwing exceptions --- Paystack.php | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/Paystack.php b/Paystack.php index 5a30a7c..05a5d16 100644 --- a/Paystack.php +++ b/Paystack.php @@ -655,14 +655,6 @@ private function parsePaystackPaystackHttpResponse() { $resp = \json_decode($this->body); - if ($resp === null || !property_exists($resp, 'status') || !$resp->status) { - throw new PaystackExceptionApiException( - "Paystack Request failed with Response: '" . - $this->messageFromApiJson($resp)."'", - $resp - ); - } - return $resp; } @@ -697,9 +689,6 @@ public function wrapUp() if ($this->okay && $this->forApi) { return $this->parsePaystackPaystackHttpResponse(); } - if (!$this->okay && $this->forApi) { - throw new \Exception($this->implodedMessages()); - } if ($this->okay) { return $this->body; }