custom/static-plugins/SamsonCustomer/src/Controller/AccountPaymentController.php line 54

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Samson\Controller;
  3. /***
  4.  *
  5.  * This file is part of the "SAMSON Shop" project.
  6.  *
  7.  * For the full copyright and license information, please read the
  8.  * LICENSE.txt file that was distributed with this source code.
  9.  *
  10.  *  (c) 2024
  11.  *
  12.  ***/
  13. use Samson\Exception\CustomerNeedsPasswordChangeException;
  14. use Shopware\Core\Checkout\Cart\Exception\CustomerNotLoggedInException;
  15. use Shopware\Core\Checkout\Customer\CustomerEntity;
  16. use Shopware\Core\Checkout\Customer\SalesChannel\AbstractChangePaymentMethodRoute;
  17. use Shopware\Core\Framework\Validation\DataBag\RequestDataBag;
  18. use Shopware\Core\System\SalesChannel\SalesChannelContext;
  19. use Shopware\Storefront\Controller\AccountPaymentController as ShopwareAccountPaymentController;
  20. use Shopware\Storefront\Page\Account\PaymentMethod\AccountPaymentMethodPageLoader;
  21. use Symfony\Component\HttpFoundation\Request;
  22. use Symfony\Component\HttpFoundation\Response;
  23. use Shopware\Core\Framework\Routing\Annotation\LoginRequired;
  24. use Shopware\Core\Framework\Routing\Annotation\RouteScope;
  25. use Shopware\Core\Framework\Routing\Annotation\Since;
  26. use Shopware\Storefront\Framework\Routing\Annotation\NoStore;
  27. use Symfony\Component\Routing\Annotation\Route;
  28. use Samson\Annotation\CustomerNeedsPasswordChange;
  29. /**
  30.  * @RouteScope(scopes={"storefront"})
  31.  */
  32. class AccountPaymentController extends ShopwareAccountPaymentController
  33. {
  34.     public function __construct(AccountPaymentMethodPageLoader   $paymentMethodPageLoader,
  35.                                 AbstractChangePaymentMethodRoute $changePaymentMethodRoute)
  36.     {
  37.         parent::__construct($paymentMethodPageLoader$changePaymentMethodRoute);
  38.     }
  39.     /**
  40.      * @Since("6.0.0.0")
  41.      * @LoginRequired()
  42.      * @CustomerNeedsPasswordChange()
  43.      * @Route("/account/payment", name="frontend.account.payment.page", options={"seo"="false"}, methods={"GET"})
  44.      * @NoStore
  45.      *
  46.      * @throws CustomerNotLoggedInException
  47.      * @throws CustomerNeedsPasswordChangeException
  48.      */
  49.     public function paymentOverview(Request $requestSalesChannelContext $context): Response
  50.     {
  51.         return parent::paymentOverview($request$context);
  52.     }
  53.     /**
  54.      * @Since("6.0.0.0")
  55.      * @LoginRequired()
  56.      * @CustomerNeedsPasswordChange()
  57.      * @Route("/account/payment", name="frontend.account.payment.save", methods={"POST"})
  58.      *
  59.      * @throws CustomerNeedsPasswordChangeException
  60.      */
  61.     public function savePayment(RequestDataBag $requestDataBagSalesChannelContext $contextCustomerEntity $customer): Response
  62.     {
  63.         return parent::savePayment($requestDataBag$context$customer);
  64.     }
  65. }