Skip to content

Commit

Permalink
Release 5.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksandarBoljanovic committed Nov 15, 2023
1 parent 6ba3bbf commit dcccd85
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/adyenofficial.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 6 additions & 1 deletion src/classes/Services/Integration/OrderService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.'
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "*"
},
Expand Down
12 changes: 6 additions & 6 deletions src/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dcccd85

Please sign in to comment.