From c85a1dacfa66d3cfc947c0a3b3f885e01a02059a Mon Sep 17 00:00:00 2001 From: Bushra Asif Date: Fri, 2 Jan 2026 11:27:07 +0500 Subject: [PATCH 1/5] Fixed a Twig rendering issue in the storefront controller for Shopware 6.6 and newer --- CHANGELOG.md | 5 +++++ composer.json | 2 +- src/Controller/CallbackController.php | 23 +++++++++++++++++++---- src/Resources/config/services.xml | 7 ++----- src/WexoAltaPay.php | 2 +- 5 files changed, 28 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75a486c..645ed69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # Changelog All notable changes to this project will be documented in this file. + +## [2.0.7] +### Fixed +- Fixed a Twig rendering issue in the storefront controller to restore compatibility with Shopware 6.6 and newer. + ## [2.0.6] ### Added - Provide a new configuration option to enable or disable changing the order status to `In Progress` after successful payment. diff --git a/composer.json b/composer.json index f67991a..bf83c4e 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "AltaPay plugin for Shopware 6", "type": "shopware-platform-plugin", "license": "MIT", - "version": "2.0.6", + "version": "2.0.7", "authors": [ { "name": "AltaPay A/S", diff --git a/src/Controller/CallbackController.php b/src/Controller/CallbackController.php index c0b63f9..e88f7fb 100644 --- a/src/Controller/CallbackController.php +++ b/src/Controller/CallbackController.php @@ -24,9 +24,10 @@ use Symfony\Component\Routing\RouterInterface; use Symfony\Contracts\Translation\TranslatorInterface; use Wexo\AltaPay\Service\PaymentService; +use Twig\Environment; #[Route(defaults: ['_routeScope' => ['storefront']])] -class CallbackController extends StorefrontController +class CallbackController { public function __construct( protected readonly PaymentService $paymentService, @@ -35,10 +36,18 @@ public function __construct( protected readonly RouterInterface $router, protected readonly TranslatorInterface $translator, protected readonly SystemConfigService $systemConfigService, - protected readonly EntityRepository $mediaRepository + protected readonly EntityRepository $mediaRepository, + protected Environment $twig ) { } + protected function renderTemplate(string $template, array $data = []): Response + { + return new Response( + $this->twig->render($template, $data) + ); + } + #[Route( path: '/altapay/getStyling', name: 'altapay.gateway.styling', @@ -98,7 +107,10 @@ public function getTerminalStyling(Request $request, SalesChannelContext $salesC 'formTemplateClass' => $formTemplateClass ]; - return $this->render('@WexoAltaPay/gateway/index.html.twig', ['gatewayData' => $data]); + return $this->renderTemplate( + '@WexoAltaPay/gateway/index.html.twig', + ['gatewayData' => $data] + ); } #[Route( @@ -114,7 +126,10 @@ public function gatewayRedirect(Request $request, SalesChannelContext $salesChan 'title' => $this->translator->trans('altapay.gateway.title'), ]; - return $this->render('@WexoAltaPay/gateway/redirect.html.twig', ['gatewayData' => $data]); + return $this->renderTemplate( + '@WexoAltaPay/gateway/index.html.twig', + ['gatewayData' => $data] + ); } #[Route( diff --git a/src/Resources/config/services.xml b/src/Resources/config/services.xml index f7c083e..ca5f425 100644 --- a/src/Resources/config/services.xml +++ b/src/Resources/config/services.xml @@ -35,14 +35,11 @@ - + - - - - + diff --git a/src/WexoAltaPay.php b/src/WexoAltaPay.php index 6c71961..c90e13d 100644 --- a/src/WexoAltaPay.php +++ b/src/WexoAltaPay.php @@ -21,7 +21,7 @@ class WexoAltaPay extends Plugin public const ALTAPAY_FIELD_SET_NAME = "wexoAltaPay"; public const ALTAPAY_PAYMENT_METHOD_FIELD_SET_NAME = "wexoAltaPayPaymentMethod"; public const ALTAPAY_CART_TOKEN = "wexoAltaPayCartToken"; - public const ALTAPAY_PLUGIN_VERSION = '2.0.6'; + public const ALTAPAY_PLUGIN_VERSION = '2.0.7'; public const ALTAPAY_PLUGIN_NAME = 'WexoAltaPay'; public function update(UpdateContext $updateContext): void From a8e110e2081f69fe9fd67165984d2ce39902be6f Mon Sep 17 00:00:00 2001 From: Bushra Asif Date: Fri, 2 Jan 2026 11:53:08 +0500 Subject: [PATCH 2/5] Update template used in gateway redirect to redirect.html.twig --- src/Controller/CallbackController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Controller/CallbackController.php b/src/Controller/CallbackController.php index e88f7fb..9b284ac 100644 --- a/src/Controller/CallbackController.php +++ b/src/Controller/CallbackController.php @@ -127,7 +127,7 @@ public function gatewayRedirect(Request $request, SalesChannelContext $salesChan ]; return $this->renderTemplate( - '@WexoAltaPay/gateway/index.html.twig', + '@WexoAltaPay/gateway/redirect.html.twig', ['gatewayData' => $data] ); } From 0a80f87d87930b39d5dbfc412f5d32b0002eb4bd Mon Sep 17 00:00:00 2001 From: Bushra Asif Date: Tue, 6 Jan 2026 19:35:40 +0000 Subject: [PATCH 3/5] Remove the unused function parameter --- src/Controller/CallbackController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Controller/CallbackController.php b/src/Controller/CallbackController.php index 9b284ac..d9efca8 100644 --- a/src/Controller/CallbackController.php +++ b/src/Controller/CallbackController.php @@ -119,7 +119,7 @@ public function getTerminalStyling(Request $request, SalesChannelContext $salesC defaults: ['auth_required' => false], methods: ['POST'] )] - public function gatewayRedirect(Request $request, SalesChannelContext $salesChannelContext): Response + public function gatewayRedirect(Request $request): Response { $data = [ 'languageCode' => $request->get('language'), From 6770f680e5ee1b8eb58a42fcebabf983b8ca8baa Mon Sep 17 00:00:00 2001 From: Bushra Asif Date: Wed, 7 Jan 2026 06:27:57 +0000 Subject: [PATCH 4/5] Update version details --- CHANGELOG.md | 2 +- README.md | 2 +- wiki.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 645ed69..83ab875 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. ## [2.0.7] ### Fixed -- Fixed a Twig rendering issue in the storefront controller to restore compatibility with Shopware 6.6 and newer. +- Fixed a Twig rendering issue in the storefront controller to restore compatibility with Shopware 6.6.9.0 and newer. ## [2.0.6] ### Added diff --git a/README.md b/README.md index fcde8ce..c9a0fa9 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Integrates your Shopware web shop to the AltaPay payments gateway. ## Compatibility -- Shopware 6.6.x (Tested version 6.6.10.5) +- Shopware 6.6.x (Tested version 6.6.9.0) - Shopware 6.7.x (Tested version 6.7.2.2) ## Changelog diff --git a/wiki.md b/wiki.md index c612f39..f48e1d2 100644 --- a/wiki.md +++ b/wiki.md @@ -146,7 +146,7 @@ The new credentials can now be used as the API Username and API Password in the - Shopware 6.6.x - Shopware 6.7.x -The latest tested versions are `6.6.10.5` and `6.7.2.2` +The latest tested versions are `6.6.9.0` and `6.7.2.2` ## Troubleshooting From d0281b35aae2d401ae4245d015fade6ecd2005e4 Mon Sep 17 00:00:00 2001 From: Bushra Asif Date: Wed, 7 Jan 2026 07:57:58 +0000 Subject: [PATCH 5/5] Update tested version for 6.7.x --- README.md | 2 +- wiki.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c9a0fa9..aded8f5 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Integrates your Shopware web shop to the AltaPay payments gateway. ## Compatibility - Shopware 6.6.x (Tested version 6.6.9.0) -- Shopware 6.7.x (Tested version 6.7.2.2) +- Shopware 6.7.x (Tested version 6.7.5.1) ## Changelog See [Changelog](CHANGELOG.md) for all the release notes. diff --git a/wiki.md b/wiki.md index f48e1d2..c30e7d0 100644 --- a/wiki.md +++ b/wiki.md @@ -146,7 +146,7 @@ The new credentials can now be used as the API Username and API Password in the - Shopware 6.6.x - Shopware 6.7.x -The latest tested versions are `6.6.9.0` and `6.7.2.2` +The latest tested versions are `6.6.9.0` and `6.7.5.1` ## Troubleshooting