diff --git a/config/shop_routing.php b/config/shop_routing.php index 9070807..d0e1c3a 100644 --- a/config/shop_routing.php +++ b/config/shop_routing.php @@ -7,12 +7,12 @@ return static function (RoutingConfigurator $routes): void { $routes->import('@PayumBundle/Resources/config/routing/cancel.xml'); - $routes->add('webgriffe_sylius_klarna_plugin.payment.process', '/order/{tokenValue}/payment/process') + $routes->add('webgriffe_sylius_klarna_plugin_payment_process', '/order/{tokenValue}/payment/process') ->controller(['webgriffe_sylius_klarna.controller.payment', 'processAction']) ->methods(['GET']) ; - $routes->add('webgriffe_sylius_klarna_plugin.payment.status', '/payment/{paymentId}/status') + $routes->add('webgriffe_sylius_klarna_plugin_payment_status', '/payment/{paymentId}/status') ->controller(['webgriffe_sylius_klarna.controller.payment', 'statusAction']) ->methods(['GET']) ->requirements(['paymentId' => '\d+']) diff --git a/src/Controller/PaymentController.php b/src/Controller/PaymentController.php index 54811af..3e86909 100644 --- a/src/Controller/PaymentController.php +++ b/src/Controller/PaymentController.php @@ -84,7 +84,7 @@ public function processAction(string $tokenValue): Response } $paymentDetails = PaymentDetails::createFromStoredPaymentDetails($storedPaymentDetails); $paymentStatusUrl = $this->router->generate( - 'webgriffe_sylius_klarna_plugin.payment.status', + 'webgriffe_sylius_klarna_plugin_payment_status', ['paymentId' => $syliusPayment->getId()], UrlGeneratorInterface::ABSOLUTE_URL, ); diff --git a/src/Payum/Action/CancelAction.php b/src/Payum/Action/CancelAction.php index 599fd5e..bfc07cc 100644 --- a/src/Payum/Action/CancelAction.php +++ b/src/Payum/Action/CancelAction.php @@ -67,8 +67,9 @@ public function execute($request): void Assert::isInstanceOf($order, OrderInterface::class); throw new HttpRedirect( - $this->router->generate('webgriffe_sylius_klarna_plugin.payment.process', [ + $this->router->generate('webgriffe_sylius_klarna_plugin_payment_process', [ 'tokenValue' => $order->getTokenValue(), + '_locale' => $order->getLocaleCode(), ]), ); } diff --git a/src/Payum/Action/CaptureAction.php b/src/Payum/Action/CaptureAction.php index 1e94815..6e69f6d 100644 --- a/src/Payum/Action/CaptureAction.php +++ b/src/Payum/Action/CaptureAction.php @@ -116,8 +116,9 @@ public function execute($request): void Assert::isInstanceOf($order, OrderInterface::class); throw new HttpRedirect( - $this->router->generate('webgriffe_sylius_klarna_plugin.payment.process', [ + $this->router->generate('webgriffe_sylius_klarna_plugin_payment_process', [ 'tokenValue' => $order->getTokenValue(), + '_locale' => $order->getLocaleCode(), ]), ); } diff --git a/tests/Behat/Page/Shop/Payment/ProcessPage.php b/tests/Behat/Page/Shop/Payment/ProcessPage.php index fdba406..f7f07df 100644 --- a/tests/Behat/Page/Shop/Payment/ProcessPage.php +++ b/tests/Behat/Page/Shop/Payment/ProcessPage.php @@ -11,7 +11,7 @@ final class ProcessPage extends SymfonyPage implements ProcessPageInterface { public function getRouteName(): string { - return 'webgriffe_sylius_klarna_plugin.payment.process'; + return 'webgriffe_sylius_klarna_plugin_payment_process'; } public function waitForRedirect(): void