Last active
August 2, 2023 11:43
-
-
Save Frank-Magmodules/04fa945998820e27dd3ac5d260e878d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Model/Mollie.php b/Model/Mollie.php | |
--- a/Model/Mollie.php (revision 717aa5fc95306653f53eb1fb5194e9a2469d89c5) | |
+++ b/Model/Mollie.php (date 1690976270932) | |
@@ -346,7 +346,7 @@ | |
try { | |
$connection->beginTransaction(); | |
- if (preg_match('/^ord_\w+$/', $transactionId)) { | |
+ if (substr($transactionId, 0, 4) == 'ord_') { | |
$result = $this->ordersProcessTraction->execute($order, $type)->toArray(); | |
} else { | |
$result = $this->paymentsApi->processTransaction($order, $mollieApi, $type, $paymentToken); | |
@@ -382,7 +382,7 @@ | |
$mollieApi = $this->loadMollieApi($apiKey); | |
- if (preg_match('/^ord_\w+$/', $transactionId)) { | |
+ if (substr($transactionId, 0, 4) == 'ord_') { | |
return $this->ordersApi->orderHasUpdate($order, $mollieApi); | |
} else { | |
return $this->paymentsApi->orderHasUpdate($order, $mollieApi); | |
diff --git a/Model/Client/Payments.php b/Model/Client/Payments.php | |
--- a/Model/Client/Payments.php (revision 717aa5fc95306653f53eb1fb5194e9a2469d89c5) | |
+++ b/Model/Client/Payments.php (date 1690976245993) | |
@@ -164,7 +164,7 @@ | |
$orderId = $order->getEntityId(); | |
$transactionId = $order->getMollieTransactionId(); | |
- if (!empty($transactionId) && !preg_match('/^ord_\w+$/', $transactionId)) { | |
+ if (!empty($transactionId) && substr($transactionId, 0, 4) != 'ord_') { | |
$payment = $mollieApi->payments->get($transactionId); | |
return $payment->getCheckoutUrl(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment