diff --git a/Service/Order/Lines/Generator/MirasvitRewards.php b/Service/Order/Lines/Generator/MirasvitRewards.php deleted file mode 100644 index ed9dd421447..00000000000 --- a/Service/Order/Lines/Generator/MirasvitRewards.php +++ /dev/null @@ -1,93 +0,0 @@ -mollieHelper = $mollieHelper; - $this->moduleManager = $moduleManager; - $this->objectManager = $objectManager; - } - - public function process(OrderInterface $order, array $orderLines): array - { - if (!$this->moduleManager->isEnabled('Mirasvit_Rewards')) { - return $orderLines; - } - - // The objectmanager is being used as most of the times this class won't be available. So only load it when we - // are sure that this module is enabled. - /** @var Purchase $purchaseHelper */ - // @phpstan-ignore-next-line - $purchaseHelper = $this->objectManager->create(Purchase::class); - - try { - $purchase = $purchaseHelper->getByOrder($order); - } catch (NoSuchEntityException $exception) { - // No rewards available. Skip it. - return $orderLines; - } - - $this->forceBaseCurrency = (bool)$this->mollieHelper->useBaseCurrency($order->getStoreId()); - $this->currency = $this->forceBaseCurrency ? $order->getBaseCurrencyCode() : $order->getOrderCurrencyCode(); - - $amount = $this->forceBaseCurrency ? $purchase->getBaseSpendAmount() : $purchase->getSpendAmount(); - - if (abs($amount) < 0.01) { - return $orderLines; - } - - $orderLines[] = [ - 'type' => 'surcharge', - 'name' => 'Mirasvit Rewards', - 'quantity' => 1, - 'unitPrice' => $this->mollieHelper->getAmountArray($this->currency, -$amount), - 'totalAmount' => $this->mollieHelper->getAmountArray($this->currency, -$amount), - 'vatRate' => 0, - 'vatAmount' => $this->mollieHelper->getAmountArray($this->currency, 0.0), - ]; - - return $orderLines; - } -} diff --git a/etc/di.xml b/etc/di.xml index 1349db4a581..cbe0d088657 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -162,7 +162,6 @@ Mollie\Payment\Service\Order\Lines\Generator\WeeeFeeGenerator Mollie\Payment\Service\Order\Lines\Generator\MageWorxRewardPoints Mollie\Payment\Service\Order\Lines\Generator\AmastyExtraFee - Mollie\Payment\Service\Order\Lines\Generator\MirasvitRewards Mollie\Payment\Service\Order\Lines\Generator\AheadworksAddFreeGift Mollie\Payment\Service\Order\Lines\Generator\MagentoGiftCard Mollie\Payment\Service\Order\Lines\Generator\MagentoGiftWrapping