From 2bfc2c90ea7dcccd28682f06af0eaec5ceaf9622 Mon Sep 17 00:00:00 2001 From: santiago-delpuerto-cko Date: Mon, 9 Oct 2017 16:25:43 +0100 Subject: [PATCH 1/3] Bugfix: the ExceptionState class was not being initialised after an exception is raised, thus, any other request would make it raise the exception again. --- com/checkout/packages/CheckoutApi/Api.php | 5 +++++ com/checkout/packages/CheckoutApi/Lib/ExceptionState.php | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/com/checkout/packages/CheckoutApi/Api.php b/com/checkout/packages/CheckoutApi/Api.php index 850cf80..59ff61a 100644 --- a/com/checkout/packages/CheckoutApi/Api.php +++ b/com/checkout/packages/CheckoutApi/Api.php @@ -48,6 +48,11 @@ public static function getApi(array $arguments = array(),$_apiClass = null) if($_apiClass) { self::setApiClass($_apiClass); } + + //Initialise the exception library + $exceptionState = CheckoutApi_Lib_Factory::getSingletonInstance('CheckoutApi_Lib_ExceptionState'); + $exceptionState->setErrorState(false); + return CheckoutApi_Lib_Factory::getSingletonInstance(self::getApiClass(),$arguments); } diff --git a/com/checkout/packages/CheckoutApi/Lib/ExceptionState.php b/com/checkout/packages/CheckoutApi/Lib/ExceptionState.php index d8119e4..e34fbf2 100644 --- a/com/checkout/packages/CheckoutApi/Lib/ExceptionState.php +++ b/com/checkout/packages/CheckoutApi/Lib/ExceptionState.php @@ -38,11 +38,11 @@ public function __construct() * @param boolean $state state of the current error * */ - private function setErrorState($state) + public function setErrorState($state) { - if(!$this->_errorState){ + //if(!$this->_errorState){ $this->_errorState = $state; - } + //} } From bc52cdaa95d3cc9e4cb56399e5a7a8411beb566e Mon Sep 17 00:00:00 2001 From: santiago-delpuerto-cko Date: Tue, 10 Oct 2017 15:34:22 +0100 Subject: [PATCH 2/3] version update to 1.2.11 --- README.md | 2 +- com/checkout/packages/CheckoutApi/Client/Constant.php | 2 +- composer.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6d85143..92b2c48 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Or require the Checkout.com package inside the composer.json of your project: ``` "require": { "php": ">=5.2.4", - "checkout/checkout-php-api": "1.2.10" + "checkout/checkout-php-api": "1.2.11" }, ``` __Manually__ diff --git a/com/checkout/packages/CheckoutApi/Client/Constant.php b/com/checkout/packages/CheckoutApi/Client/Constant.php index 6021902..4f03e34 100644 --- a/com/checkout/packages/CheckoutApi/Client/Constant.php +++ b/com/checkout/packages/CheckoutApi/Client/Constant.php @@ -24,5 +24,5 @@ final class CheckoutApi_Client_Constant const VERSION = 'v2'; const STATUS_CAPTURE = 'Captured'; const STATUS_REFUND = 'Refunded'; - const LIB_VERSION = 'v1.2.10'; + const LIB_VERSION = 'v1.2.11'; } diff --git a/composer.json b/composer.json index d28b735..e6fa8d9 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "checkout/checkout-php-api", "description": "Checkout PHP API Library", "homepage": "https://github.com/checkout/checkout-php-library", - "version": "1.2.10", + "version": "1.2.11", "type": "library", "license": "MIT", "keywords": ["checkout.com","payment","gateway","online payment","checkoutcom","GW3","CKO"], From 30e30ee6bca11d33ab7f123ac9c46e4a0132c08f Mon Sep 17 00:00:00 2001 From: santiago-delpuerto-cko Date: Tue, 10 Oct 2017 15:39:35 +0100 Subject: [PATCH 3/3] remove commented code --- com/checkout/packages/CheckoutApi/Lib/ExceptionState.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/com/checkout/packages/CheckoutApi/Lib/ExceptionState.php b/com/checkout/packages/CheckoutApi/Lib/ExceptionState.php index e34fbf2..5ac5a01 100644 --- a/com/checkout/packages/CheckoutApi/Lib/ExceptionState.php +++ b/com/checkout/packages/CheckoutApi/Lib/ExceptionState.php @@ -40,9 +40,7 @@ public function __construct() */ public function setErrorState($state) { - //if(!$this->_errorState){ - $this->_errorState = $state; - //} + $this->_errorState = $state; }