Skip to content

Commit

Permalink
Merge pull request #94 from santiago-delpuerto-cko/master
Browse files Browse the repository at this point in the history
Bugfix: the ExceptionState class was not being initialised after an exception is raised, thus, any other request would make it raise the exception again.
  • Loading branch information
nicolas-maalouf-cko authored Oct 10, 2017
2 parents cdb7fc3 + 30e30ee commit 6a99ef2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand Down
5 changes: 5 additions & 0 deletions com/checkout/packages/CheckoutApi/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion com/checkout/packages/CheckoutApi/Client/Constant.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
6 changes: 2 additions & 4 deletions com/checkout/packages/CheckoutApi/Lib/ExceptionState.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@ public function __construct()
* @param boolean $state state of the current error
*
*/
private function setErrorState($state)
public function setErrorState($state)
{
if(!$this->_errorState){
$this->_errorState = $state;
}
$this->_errorState = $state;

}

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down

0 comments on commit 6a99ef2

Please sign in to comment.