Skip to content

Commit

Permalink
removed commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
mandan2 committed Sep 11, 2023
1 parent 6b0a06a commit 254242d
Showing 1 changed file with 0 additions and 53 deletions.
53 changes: 0 additions & 53 deletions subscription/Handler/RecurringOrderHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,16 @@

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;
use Mollie\Api\Resources\Subscription as MollieSubscription;
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;
Expand All @@ -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;
Expand Down Expand Up @@ -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 */
Expand All @@ -88,9 +74,6 @@ public function __construct(
ClockInterface $clock,
Shop $shop,
MailService $mailService,
MolOrderPaymentFeeRepositoryInterface $molOrderPaymentFeeRepository,
UpdateOrderTotalsAction $updateOrderTotalsAction,
CreateOrderPaymentFeeAction $createOrderPaymentFeeAction,
ConfigurationAdapter $configuration,
RecurringOrdersProductRepositoryInterface $recurringOrdersProductRepository
) {
Expand All @@ -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;
}
Expand Down Expand Up @@ -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]);
}

Expand Down

0 comments on commit 254242d

Please sign in to comment.