Skip to content

Instantly share code, notes, and snippets.

@Frank-Magmodules
Created July 28, 2023 13:46
Show Gist options
  • Save Frank-Magmodules/daae475844f4086d81452d32c6385fb5 to your computer and use it in GitHub Desktop.
Save Frank-Magmodules/daae475844f4086d81452d32c6385fb5 to your computer and use it in GitHub Desktop.
diff --git a/Model/Client/Payments.php b/Model/Client/Payments.php
index f01b536..158b2ef 100644
--- a/Model/Client/Payments.php
+++ b/Model/Client/Payments.php
@@ -210,7 +210,7 @@ class Payments extends AbstractModel
$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();
}
diff --git a/Model/Mollie.php b/Model/Mollie.php
index a4076ca..2f07c4d 100644
--- a/Model/Mollie.php
+++ b/Model/Mollie.php
@@ -358,7 +358,7 @@ class Mollie extends Adapter
$type,
$paymentToken
) {
- if (preg_match('/^ord_\w+$/', $transactionId)) {
+ if (substr($transactionId, 0, 4) == 'ord_') {
$result = $this->ordersProcessTraction->execute($order, $type)->toArray();
} else {
$mollieApi = $this->mollieApiClient->loadByStore($order->getStoreId());
@@ -388,7 +388,7 @@ class Mollie extends Adapter
$mollieApi = $this->mollieApiClient->loadByStore($order->getStoreId());
- 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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment