Skip to content

Commit

Permalink
NTR: stan fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitalij Mik committed Sep 2, 2024
1 parent 6338971 commit cc309a7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 20 deletions.
7 changes: 7 additions & 0 deletions src/Checkout/Cart/ExpressCartItemAddRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ public function getDecorated(): AbstractCartItemAddRoute
return $this->cartItemAddRoute;
}

/**
* @param Request $request
* @param Cart $cart
* @param SalesChannelContext $context
* @param ?array<mixed> $items
* @return CartResponse
*/
public function add(Request $request, Cart $cart, SalesChannelContext $context, ?array $items): CartResponse
{
//we have to create a new request from global variables, because the request is not set here in the route
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use Kiener\MolliePayments\Components\ApplePayDirect\ApplePayDirect;
use Kiener\MolliePayments\Controller\Storefront\AbstractStoreFrontController;
use Kiener\MolliePayments\Repository\Customer\CustomerRepositoryInterface;
use Kiener\MolliePayments\Service\Cart\CartBackupService;
use Kiener\MolliePayments\Service\OrderService;
use Kiener\MolliePayments\Traits\Storefront\RedirectTrait;
use Psr\Log\LoggerInterface;
Expand All @@ -21,7 +20,6 @@
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Session\Flash\FlashBag;
use Symfony\Component\Routing\RouterInterface;
use Throwable;

Expand All @@ -42,20 +40,12 @@ class ApplePayDirectControllerBase extends AbstractStoreFrontController
*/
private $applePay;

/**
* @var CartBackupService
*/
private $cartBackupService;

/**
* @var RouterInterface
*/
private $router;

/**
* @var ?FlashBag
*/
private $flashBag;

/**
* @var FlowBuilderDispatcherAdapterInterface
Expand Down Expand Up @@ -87,20 +77,18 @@ class ApplePayDirectControllerBase extends AbstractStoreFrontController
* @param ApplePayDirect $applePay
* @param RouterInterface $router
* @param LoggerInterface $logger
* @param CartBackupService $cartBackup
* @param null|FlashBag $sessionFlashBag
* @param FlowBuilderFactory $flowBuilderFactory
* @param FlowBuilderEventFactory $flowBuilderEventFactory
* @param CustomerRepositoryInterface $repoCustomers
* @param OrderService $orderService
* @throws \Exception
*/
public function __construct(ApplePayDirect $applePay, RouterInterface $router, LoggerInterface $logger, CartBackupService $cartBackup, FlowBuilderFactory $flowBuilderFactory, FlowBuilderEventFactory $flowBuilderEventFactory, CustomerRepositoryInterface $repoCustomers, OrderService $orderService)
public function __construct(ApplePayDirect $applePay, RouterInterface $router, LoggerInterface $logger, FlowBuilderFactory $flowBuilderFactory, FlowBuilderEventFactory $flowBuilderEventFactory, CustomerRepositoryInterface $repoCustomers, OrderService $orderService)
{
$this->applePay = $applePay;
$this->router = $router;
$this->logger = $logger;
$this->cartBackupService = $cartBackup;

$this->repoCustomers = $repoCustomers;
$this->orderService = $orderService;

Expand Down Expand Up @@ -328,12 +316,6 @@ public function setShippingMethod(SalesChannelContext $context, Request $request
public function startPayment(SalesChannelContext $context, Request $request): Response
{
try {
# we clear our cart backup now
# we are in the user redirection process where a restoring wouldnt make sense
# because from now on we would end on the cart page where we could even switch payment method.
// $this->cartBackupService->clearBackup($context);


$email = (string)$request->get('email', '');
$firstname = (string)$request->get('firstname', '');
$lastname = (string)$request->get('lastname', '');
Expand Down

0 comments on commit cc309a7

Please sign in to comment.