diff --git a/CHANGELOG.md b/CHANGELOG.md index c25a99ff..54f436da 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [1.2.5.1][1.2.5.1] + +### Fix +* A bug which led to an error when trying to cancel the initial transaction of a charged invoice. + ## [1.2.5.0][1.2.5.0] ### Added @@ -332,3 +337,4 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [1.2.3.0]: https://github.com/heidelpay/heidelpayPHP/compare/1.2.2.0..1.2.3.0 [1.2.4.0]: https://github.com/heidelpay/heidelpayPHP/compare/1.2.3.0..1.2.4.0 [1.2.5.0]: https://github.com/heidelpay/heidelpayPHP/compare/1.2.4.0..1.2.5.0 +[1.2.5.1]: https://github.com/heidelpay/heidelpayPHP/compare/1.2.5.0..1.2.5.1 diff --git a/src/Heidelpay.php b/src/Heidelpay.php index 9eb65262..4402db82 100755 --- a/src/Heidelpay.php +++ b/src/Heidelpay.php @@ -58,7 +58,7 @@ class Heidelpay implements HeidelpayParentInterface const BASE_URL = 'api.heidelpay.com'; const API_VERSION = 'v1'; const SDK_TYPE = 'HeidelpayPHP'; - const SDK_VERSION = '1.2.5.0'; + const SDK_VERSION = '1.2.5.1'; /** @var string $key */ private $key; diff --git a/src/Resources/Payment.php b/src/Resources/Payment.php index 9df4e8c0..b7c6724c 100755 --- a/src/Resources/Payment.php +++ b/src/Resources/Payment.php @@ -713,6 +713,7 @@ public function cancelAmount( } catch (HeidelpayApiException $e) { $allowedErrors = [ ApiResponseCodes::API_ERROR_ALREADY_CANCELLED, + ApiResponseCodes::API_ERROR_ALREADY_CHARGED, ApiResponseCodes::API_ERROR_ALREADY_CHARGED_BACK ]; diff --git a/test/unit/Resources/PaymentCancelTest.php b/test/unit/Resources/PaymentCancelTest.php index 47a89939..bb17815a 100644 --- a/test/unit/Resources/PaymentCancelTest.php +++ b/test/unit/Resources/PaymentCancelTest.php @@ -426,7 +426,8 @@ public function allowedErrorCodesDuringChargeCancel(): array { return [ 'already cancelled' => [ApiResponseCodes::API_ERROR_ALREADY_CANCELLED, false], - 'already chargedBack' => [ApiResponseCodes::API_ERROR_ALREADY_CANCELLED, false], + 'already charged' => [ApiResponseCodes::API_ERROR_ALREADY_CHARGED, false], + 'already chargedBack' => [ApiResponseCodes::API_ERROR_ALREADY_CHARGED_BACK, false], 'other' => [ApiResponseCodes::API_ERROR_BASKET_ITEM_IMAGE_INVALID_URL, true] ]; }