AccountPaymentMethodPageLoadedHook example

private readonly AccountPaymentMethodPageLoader $paymentMethodPageLoader,
        private readonly AbstractChangePaymentMethodRoute $changePaymentMethodRoute
    ) {
    }

    #[Route(path: '/account/payment', name: 'frontend.account.payment.page', options: ['seo' => false], defaults: ['_loginRequired' => true, '_noStore' => true], methods: ['GET'])]     #[Route(path: '/account/payment', name: 'frontend.account.payment.page', options: ['seo' => false], defaults: ['_noStore' => true], methods: ['GET'])]     public function paymentOverview(Request $request, SalesChannelContext $context): Response
    {
        $page = $this->paymentMethodPageLoader->load($request$context);

        $this->hook(new AccountPaymentMethodPageLoadedHook($page$context));

        return $this->renderStorefront('@Storefront/storefront/page/account/payment/index.html.twig', ['page' => $page]);
    }

    #[Route(path: '/account/payment', name: 'frontend.account.payment.save', defaults: ['_loginRequired' => true], methods: ['POST'])]     public function savePayment(RequestDataBag $requestDataBag, SalesChannelContext $context, CustomerEntity $customer): Response
    {
        try {
            $paymentMethodId = $requestDataBag->getAlnum('paymentMethodId');

            $this->changePaymentMethodRoute->change(
                
Home | Imprint | This part of the site doesn't use cookies.