From 1e99ea4ae89194df6bcdd65e0799eaf531e0ab2f Mon Sep 17 00:00:00 2001 From: Volodymyr Klymenko Date: Thu, 12 Jan 2023 14:02:42 +0200 Subject: [PATCH 1/2] Fixed issue when order id already is in used --- Gateway/Command/CommandManager.php | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/Gateway/Command/CommandManager.php b/Gateway/Command/CommandManager.php index 3369c32..db74e91 100644 --- a/Gateway/Command/CommandManager.php +++ b/Gateway/Command/CommandManager.php @@ -58,19 +58,10 @@ public function __construct( */ public function initiatePayment(InfoInterface $payment, $arguments) { - try { - return $this->executeByCode('initiate', $payment, $arguments); - } catch (\Exception $e) { - if ($payment instanceof QuotePayment) { - // process error "orderId is already in used and must be unique" - if ((int)$e->getCode() === 34) { - $quote = $payment->getQuote(); - $quote->setReservedOrderId(null); - - return $this->executeByCode('initiate', $payment, $arguments); - } - } - } + $quote = $payment->getQuote(); + $quote->setReservedOrderId(null); + + return $this->executeByCode('initiate', $payment, $arguments); } /** From ad6dc3e07683725eb4c8c4a3b55a3b8dd401d0b0 Mon Sep 17 00:00:00 2001 From: Volodymyr Klymenko Date: Thu, 12 Jan 2023 14:04:51 +0200 Subject: [PATCH 2/2] Increase module version --- etc/module.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/module.xml b/etc/module.xml index 927133c..c0b1123 100644 --- a/etc/module.xml +++ b/etc/module.xml @@ -14,7 +14,7 @@ ~ IN THE SOFTWARE. --> - +