Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.9.0 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.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ Integrates your Shopware web shop to the AltaPay payments gateway.
</td></tr> </table>

## Compatibility
- Shopware 6.6.x (Tested version 6.6.10.5)
- Shopware 6.7.x (Tested version 6.7.2.2)
- Shopware 6.6.x (Tested version 6.6.9.0)
- Shopware 6.7.x (Tested version 6.7.5.1)

## Changelog
See [Changelog](CHANGELOG.md) for all the release notes.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
25 changes: 20 additions & 5 deletions src/Controller/CallbackController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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',
Expand Down Expand Up @@ -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(
Expand All @@ -107,14 +119,17 @@ 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'),
'title' => $this->translator->trans('altapay.gateway.title'),
];

return $this->render('@WexoAltaPay/gateway/redirect.html.twig', ['gatewayData' => $data]);
return $this->renderTemplate(
'@WexoAltaPay/gateway/redirect.html.twig',
['gatewayData' => $data]
);
}

#[Route(
Expand Down
7 changes: 2 additions & 5 deletions src/Resources/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,11 @@
<argument type="service" id="Wexo\AltaPay\Service\PaymentService" />
<argument type="service" id="order.repository" />
<argument type="service" id="logger" />
<argument type="service" id="router" />
<argument type="service" id="router.default" />
<argument type="service" id="translator" />
<argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService"/>
<argument type="service" id="media.repository"/>
<argument type="service" id="Shopware\Core\System\SalesChannel\Context\SalesChannelContextRestorer"/>
<call method="setContainer">
<argument type="service" id="service_container"/>
</call>
<argument type="service" id="twig"/>
</service>
<service id="Wexo\AltaPay\Controller\ApiController" public="true">
<argument type="service" id="Wexo\AltaPay\Service\PaymentService" />
Expand Down
2 changes: 1 addition & 1 deletion src/WexoAltaPay.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion wiki.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.5.1`

## Troubleshooting

Expand Down