Skip to content

Instantly share code, notes, and snippets.

View Frank-Magmodules's full-sized avatar

Frank Tiggelman Frank-Magmodules

View GitHub Profile
diff --git a/Model/OrderLines.php b/Model/OrderLines.php
index f1eaf9ef..1e135d1c 100644
--- a/Model/OrderLines.php
+++ b/Model/OrderLines.php
@@ -214,7 +214,14 @@ public function getShipmentOrderLines(ShipmentInterface $shipment): array
$orderItemId = $item->getOrderItemId();
$lineId = $this->getOrderLineByItemId($orderItemId)->getLineId();
- $line = ['id' => $lineId, 'quantity' => $item->getQty()];
+
diff --git a/Service/Order/Lines/Generator/MagentoRewardPoints.php b/Service/Order/Lines/Generator/MagentoRewardPoints.php
new file mode 100644
index 00000000..66513849
--- /dev/null
+++ b/Service/Order/Lines/Generator/MagentoRewardPoints.php
@@ -0,0 +1,55 @@
+<?php
+
+declare(strict_types=1);
+
@Frank-Magmodules
Frank-Magmodules / 733.diff
Created February 15, 2024 09:45
733.diff
diff --git a/Model/OrderLines.php b/Model/OrderLines.php
index 5e98a29f..f1eaf9ef 100644
--- a/Model/OrderLines.php
+++ b/Model/OrderLines.php
@@ -16,7 +16,6 @@
use Magento\Sales\Api\Data\CreditmemoItemInterface;
use Magento\Sales\Api\Data\OrderInterface;
use Magento\Sales\Api\Data\ShipmentInterface;
-use Magento\Sales\Api\Data\ShipmentItemInterface;
use Magento\Sales\Model\Order;
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();
diff --git a/Observer/LockUnlockOrder.php b/Observer/LockUnlockOrder.php
index e1bf878..f43321a 100644
--- a/Observer/LockUnlockOrder.php
+++ b/Observer/LockUnlockOrder.php
@@ -7,7 +7,7 @@ use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Exception\LocalizedException;
use Magento\Sales\Api\Data\OrderInterface;
use Magento\Sales\Api\Data\ShipmentInterface;
-use Mollie\Payment\Config;
+use Mollie\Payment\Observer\SalesOrderShipmentSaveBefore\CreateMollieShipment;
$payment = $mollie->payments->create(
array (
'amount' =>
array (
'currency' => 'EUR',
'value' => '0.01',
),
'description' => '000000460',
'billingAddress' =>
array (
diff --git a/Model/Client/Payments.php b/Model/Client/Payments.php
index 35dee01..943aa2e 100644
--- a/Model/Client/Payments.php
+++ b/Model/Client/Payments.php
@@ -178,7 +178,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_') {
diff --git a/Model/Client/Payments.php b/Model/Client/Payments.php
index 4251d29..2aaea59 100644
--- a/Model/Client/Payments.php
+++ b/Model/Client/Payments.php
@@ -221,7 +221,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_') {
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_') {
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_') {