Skip to content

Instantly share code, notes, and snippets.

@Frank-Magmodules
Created July 28, 2023 13:45
Show Gist options
  • Save Frank-Magmodules/9d2efd59360d9c8cd62997906203a906 to your computer and use it in GitHub Desktop.
Save Frank-Magmodules/9d2efd59360d9c8cd62997906203a906 to your computer and use it in GitHub Desktop.
diff --git a/Model/Client/Payments.php b/Model/Client/Payments.php
index 598a57c..e54ed82 100644
--- a/Model/Client/Payments.php
+++ b/Model/Client/Payments.php
@@ -209,7 +209,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