diff --git a/subscription/Handler/RecurringOrderHandler.php b/subscription/Handler/RecurringOrderHandler.php index 8a8e2582b..6e8a268ee 100644 --- a/subscription/Handler/RecurringOrderHandler.php +++ b/subscription/Handler/RecurringOrderHandler.php @@ -6,8 +6,6 @@ use Cart; use Mollie; -use Mollie\Action\CreateOrderPaymentFeeAction; -use Mollie\Action\UpdateOrderTotalsAction; use Mollie\Adapter\ConfigurationAdapter; use Mollie\Adapter\Shop; use Mollie\Api\Resources\Payment; @@ -15,14 +13,9 @@ use Mollie\Api\Types\PaymentStatus; use Mollie\Api\Types\SubscriptionStatus; use Mollie\Config\Config; -use Mollie\DTO\CreateOrderPaymentFeeActionData; -use Mollie\DTO\UpdateOrderTotalsData; use Mollie\Errors\Http\HttpStatusCode; -use Mollie\Exception\CouldNotCreateOrderPaymentFee; -use Mollie\Exception\CouldNotUpdateOrderTotals; use Mollie\Exception\OrderCreationException; use Mollie\Exception\TransactionException; -use Mollie\Repository\MolOrderPaymentFeeRepositoryInterface; use Mollie\Repository\PaymentMethodRepositoryInterface; use Mollie\Service\MailService; use Mollie\Service\MollieOrderCreationService; @@ -35,7 +28,6 @@ use Mollie\Subscription\Repository\RecurringOrdersProductRepositoryInterface; use Mollie\Subscription\Utility\ClockInterface; use Mollie\Utility\SecureKeyUtility; -use MolOrderPaymentFee; use MolRecurringOrder; use MolRecurringOrdersProduct; use Order; @@ -65,12 +57,6 @@ class RecurringOrderHandler private $shop; /** @var MailService */ private $mailService; - /** @var MolOrderPaymentFeeRepositoryInterface */ - private $molOrderPaymentFeeRepository; - /** @var UpdateOrderTotalsAction */ - private $updateOrderTotalsAction; - /** @var CreateOrderPaymentFeeAction */ - private $createOrderPaymentFeeAction; /** @var ConfigurationAdapter */ private $configuration; /** @var RecurringOrdersProductRepositoryInterface */ @@ -88,9 +74,6 @@ public function __construct( ClockInterface $clock, Shop $shop, MailService $mailService, - MolOrderPaymentFeeRepositoryInterface $molOrderPaymentFeeRepository, - UpdateOrderTotalsAction $updateOrderTotalsAction, - CreateOrderPaymentFeeAction $createOrderPaymentFeeAction, ConfigurationAdapter $configuration, RecurringOrdersProductRepositoryInterface $recurringOrdersProductRepository ) { @@ -105,9 +88,6 @@ public function __construct( $this->clock = $clock; $this->shop = $shop; $this->mailService = $mailService; - $this->molOrderPaymentFeeRepository = $molOrderPaymentFeeRepository; - $this->updateOrderTotalsAction = $updateOrderTotalsAction; - $this->createOrderPaymentFeeAction = $createOrderPaymentFeeAction; $this->configuration = $configuration; $this->recurringOrdersProductRepository = $recurringOrdersProductRepository; } @@ -227,39 +207,6 @@ private function createSubscription(Payment $transaction, MolRecurringOrder $rec $this->mollieOrderCreationService->createMolliePayment($transaction, (int) $newCart->id, $order->reference, (int) $orderId, PaymentStatus::STATUS_PAID); - // TODO let's not set payment fee for subscription - -// /** @var MolOrderPaymentFee|null $molOrderPaymentFee */ -// $molOrderPaymentFee = $this->molOrderPaymentFeeRepository->findOneBy([ -// 'id_order' => $recurringOrder->id_order, -// ]); -// -// if ($molOrderPaymentFee) { -// try { -// $this->createOrderPaymentFeeAction->run(CreateOrderPaymentFeeActionData::create( -// $orderId, -// (int) $newCart->id, -// (float) $molOrderPaymentFee->fee_tax_incl, -// (float) $molOrderPaymentFee->fee_tax_excl -// )); -// } catch (CouldNotCreateOrderPaymentFee $exception) { -// throw CouldNotHandleRecurringOrder::failedToCreateOrderPaymentFee($exception); -// } -// -// try { -// $this->updateOrderTotalsAction->run(UpdateOrderTotalsData::create( -// $orderId, -// (float) $molOrderPaymentFee->fee_tax_incl, -// (float) $molOrderPaymentFee->fee_tax_excl, -// (float) $transaction->amount->value, -// (float) $cart->getOrderTotal(true, Cart::BOTH), -// (float) $cart->getOrderTotal(false, Cart::BOTH) -// )); -// } catch (CouldNotUpdateOrderTotals $exception) { -// throw CouldNotHandleRecurringOrder::failedToUpdateOrderTotalWithPaymentFee($exception); -// } -// } - $this->orderStatusService->setOrderStatus($orderId, (int) Config::getStatuses()[$transaction->status]); }