<?php declare(strict_types=1);
namespace Samson\Controller;
/***
*
* This file is part of the "SAMSON Shop" project.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* (c) 2024
*
***/
use Samson\Exception\CustomerNeedsPasswordChangeException;
use Shopware\Core\Checkout\Cart\Exception\CustomerNotLoggedInException;
use Shopware\Core\Checkout\Customer\CustomerEntity;
use Shopware\Core\Checkout\Customer\SalesChannel\AbstractChangePaymentMethodRoute;
use Shopware\Core\Framework\Validation\DataBag\RequestDataBag;
use Shopware\Core\System\SalesChannel\SalesChannelContext;
use Shopware\Storefront\Controller\AccountPaymentController as ShopwareAccountPaymentController;
use Shopware\Storefront\Page\Account\PaymentMethod\AccountPaymentMethodPageLoader;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Shopware\Core\Framework\Routing\Annotation\LoginRequired;
use Shopware\Core\Framework\Routing\Annotation\RouteScope;
use Shopware\Core\Framework\Routing\Annotation\Since;
use Shopware\Storefront\Framework\Routing\Annotation\NoStore;
use Symfony\Component\Routing\Annotation\Route;
use Samson\Annotation\CustomerNeedsPasswordChange;
/**
* @RouteScope(scopes={"storefront"})
*/
class AccountPaymentController extends ShopwareAccountPaymentController
{
public function __construct(AccountPaymentMethodPageLoader $paymentMethodPageLoader,
AbstractChangePaymentMethodRoute $changePaymentMethodRoute)
{
parent::__construct($paymentMethodPageLoader, $changePaymentMethodRoute);
}
/**
* @Since("6.0.0.0")
* @LoginRequired()
* @CustomerNeedsPasswordChange()
* @Route("/account/payment", name="frontend.account.payment.page", options={"seo"="false"}, methods={"GET"})
* @NoStore
*
* @throws CustomerNotLoggedInException
* @throws CustomerNeedsPasswordChangeException
*/
public function paymentOverview(Request $request, SalesChannelContext $context): Response
{
return parent::paymentOverview($request, $context);
}
/**
* @Since("6.0.0.0")
* @LoginRequired()
* @CustomerNeedsPasswordChange()
* @Route("/account/payment", name="frontend.account.payment.save", methods={"POST"})
*
* @throws CustomerNeedsPasswordChangeException
*/
public function savePayment(RequestDataBag $requestDataBag, SalesChannelContext $context, CustomerEntity $customer): Response
{
return parent::savePayment($requestDataBag, $context, $customer);
}
}