diff --git a/src/adyenofficial.php b/src/adyenofficial.php index c937e020..c9c6e126 100755 --- a/src/adyenofficial.php +++ b/src/adyenofficial.php @@ -46,7 +46,7 @@ public function __construct() { $this->name = 'adyenofficial'; $this->tab = 'payments_gateways'; - $this->version = '5.0.6'; + $this->version = '5.0.7'; $this->author = $this->l('Adyen'); $this->need_instance = 0; diff --git a/src/classes/Services/Integration/OrderService.php b/src/classes/Services/Integration/OrderService.php index dc7f0dcf..c7c43c20 100644 --- a/src/classes/Services/Integration/OrderService.php +++ b/src/classes/Services/Integration/OrderService.php @@ -8,10 +8,12 @@ use Adyen\Core\BusinessLogic\Domain\TransactionHistory\Repositories\TransactionHistoryRepository; use Adyen\Core\BusinessLogic\Domain\Webhook\Models\Webhook; use Adyen\Core\Infrastructure\ORM\Exceptions\RepositoryClassException; +use Adyen\Core\Infrastructure\Utility\TimeProvider; use Adyen\Webhook\EventCodes; use AdyenPayment\Classes\Services\RefundHandler; use AdyenPayment\Classes\Version\Contract\VersionHandler; use Cart; +use DateTime; use Db; use Order; use OrderHistory; @@ -70,8 +72,11 @@ public function orderExists(string $merchantReference): bool } if (!isset($order->current_state) || (int)$order->current_state === 0) { + $orderCreationTime = new DateTime($order->date_add); + $now = TimeProvider::getInstance()->getCurrentLocalTime(); + $passedTimeSinceOrderCreation = $now->getTimestamp() - $orderCreationTime->getTimestamp(); throw new Exception( - 'Order with cart ID:' . $merchantReference . ' can not be updated, because order is still not completed. Order is not in initial state.' + 'Order with cart ID:' . $merchantReference . ' can not be updated, because order is still not initialized. Order is not in initial state after ' . $passedTimeSinceOrderCreation . ' seconds since its creation.' ); } diff --git a/src/composer.json b/src/composer.json index 49f98d69..f45a5d38 100755 --- a/src/composer.json +++ b/src/composer.json @@ -41,7 +41,7 @@ "php": "^7.2|^7.4|^8.0", "ext-json": "*", "ext-zip": "*", - "adyen/integration-core": "1.0.5", + "adyen/integration-core": "1.0.6", "ext-simplexml": "*", "ext-openssl": "*" }, diff --git a/src/composer.lock b/src/composer.lock index 84b80141..d3c77ffd 100755 --- a/src/composer.lock +++ b/src/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0a05f14ebc9d4bf1e2c7745be88f1b49", + "content-hash": "d59fc544693c0a3490a8e2badf3de38c", "packages": [ { "name": "adyen/integration-core", - "version": "1.0.5", + "version": "1.0.6", "source": { "type": "git", "url": "git@github.com:Adyen/adyen-php-plugin-core.git", - "reference": "71d5b164cf6d11c1c683d400924aa897b889b6e9" + "reference": "faaa9076a3df5335fdc8830869d161a1b3766736" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Adyen/adyen-php-plugin-core/zipball/71d5b164cf6d11c1c683d400924aa897b889b6e9", - "reference": "71d5b164cf6d11c1c683d400924aa897b889b6e9", + "url": "https://api.github.com/repos/Adyen/adyen-php-plugin-core/zipball/faaa9076a3df5335fdc8830869d161a1b3766736", + "reference": "faaa9076a3df5335fdc8830869d161a1b3766736", "shasum": "" }, "require": { @@ -48,7 +48,7 @@ "proprietary" ], "description": "Core Adyen integration library", - "time": "2023-11-09T11:55:44+00:00" + "time": "2023-11-14T15:07:26+00:00" }, { "name": "adyen/php-webhook-module",