Skip to content

Commit

Permalink
Fix intl on process page
Browse files Browse the repository at this point in the history
  • Loading branch information
lruozzi9 committed Jul 4, 2024
1 parent cde72e6 commit 4ca4889
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions config/shop_routing.php
Original file line number Diff line number Diff line change
Expand Up @@ -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+'])
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/PaymentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);
Expand Down
3 changes: 2 additions & 1 deletion src/Payum/Action/CancelAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
]),
);
}
Expand Down
3 changes: 2 additions & 1 deletion src/Payum/Action/CaptureAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
]),
);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Behat/Page/Shop/Payment/ProcessPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4ca4889

Please sign in to comment.