diff --git a/CHANGELOG_de-DE.md b/CHANGELOG_de-DE.md
index 3e0ea255..3a70d737 100644
--- a/CHANGELOG_de-DE.md
+++ b/CHANGELOG_de-DE.md
@@ -1,3 +1,8 @@
+# 5.12.5
+* Fix: Fehlende Übersetzungen neuer Zahlungsarten konnten nach einem Update im Frontend zu einer Fehlermeldung führen
+* Entfernung von legacy RouteScope/Annotation-Klassen für SW6.4
+* Fix: UI-JS test URL entfernt
+
# 5.12.4
* Verbesserung: Shopware-Bestellnummer wird nun in den Zahlungsdetails gespeichert, um das Tracking von Unzer Paylater-Zahlungen zu verbessern
* Fehlerbehebung: Zahlungsarten für Rechnung und Ratenzahlung wurden auf die neuen offiziellen Bezeichnungen aktualisiert (nur Deutsch). Betrifft nur Neuinstallationen
diff --git a/CHANGELOG_en-GB.md b/CHANGELOG_en-GB.md
index 4d75f7c2..ff630267 100644
--- a/CHANGELOG_en-GB.md
+++ b/CHANGELOG_en-GB.md
@@ -1,3 +1,8 @@
+# 5.12.5
+* Fix: Missing translation of new payment methods could display an error in Frontend after updating
+* Removed legacy RouteScope/Annotation-classes for SW6.4
+* Fix: UI-JS test URL removed
+
# 5.12.4
* Improvement: Save Shopware Order Number in payment details for Unzer Paylater payment tracking
* Fix: Changed payment method names for Invoice and Installment to the new official brands (German only). This will only affect new installs
diff --git a/composer.json b/composer.json
index d76918c4..019cc075 100644
--- a/composer.json
+++ b/composer.json
@@ -1,7 +1,7 @@
{
"name": "unzerdev/shopware6",
"description": "Unzer payment integration for Shopware 6",
- "version": "5.12.4",
+ "version": "5.12.5",
"type": "shopware-platform-plugin",
"license": "Apache-2.0",
"minimum-stability": "dev",
diff --git a/src/Components/BackwardsCompatibility/Filesystem.php b/src/Components/BackwardsCompatibility/Filesystem.php
deleted file mode 100644
index 4997b08f..00000000
--- a/src/Components/BackwardsCompatibility/Filesystem.php
+++ /dev/null
@@ -1,22 +0,0 @@
-has($path)) {
- return $filesystem->update($path, $content);
- }
-
- /** @phpstan-ignore-next-line */
- return $filesystem->write($path, $content);
- }
-}
diff --git a/src/Components/BackwardsCompatibility/RouteScope.php b/src/Components/BackwardsCompatibility/RouteScope.php
deleted file mode 100644
index 7bad8521..00000000
--- a/src/Components/BackwardsCompatibility/RouteScope.php
+++ /dev/null
@@ -1,24 +0,0 @@
- ['api']])]
class UnzerPaymentConfigurationController extends AbstractController
{
/**
@@ -51,10 +46,7 @@ public function __construct(
$this->webhookRegistrator = $webhookRegistrator;
}
- /**
- * @Route("/api/_action/unzer-payment/validate-credentials", name="api.action.unzer.validate.credentials", methods={"POST"})
- * @Route("/api/v{version}/_action/unzer-payment/validate-credentials", name="api.action.unzer.validate.credentials.version", methods={"POST"})
- */
+ #[Route(path: '/api/_action/unzer-payment/validate-credentials', name: 'api.action.unzer.validate.credentials', methods: ['POST'])]
public function validateCredentials(RequestDataBag $dataBag): JsonResponse
{
$privateKey = $dataBag->get('privateKey');
@@ -87,10 +79,7 @@ public function validateCredentials(RequestDataBag $dataBag): JsonResponse
return new JsonResponse([], $responseCode);
}
- /**
- * @Route("/api/_action/unzer-payment/get-google-pay-gateway-merchant-id", name="api.action.unzer.get.google.pay.gateway.merchant.id", methods={"GET"})
- * @Route("/api/v{version}/_action/unzer-payment/get-google-pay-gateway-merchant-id", name="api.action.unzer.get.google.pay.gateway.merchant.id.version", methods={"GET"})
- */
+ #[Route(path: '/api/_action/unzer-payment/get-google-pay-gateway-merchant-id', name: 'api.action.unzer.get.google.pay.gateway.merchant.id', methods: ['GET'])]
public function getGooglePayGatewayMerchantId(Request $request): JsonResponse
{
try {
@@ -114,10 +103,7 @@ public function getGooglePayGatewayMerchantId(Request $request): JsonResponse
}
}
- /**
- * @Route("/api/_action/unzer-payment/register-webhooks", name="api.action.unzer.webhooks.register", methods={"POST"})
- * @Route("/api/v{version}/_action/unzer-payment/register-webhooks", name="api.action.unzer.webhooks.register.version", methods={"POST"})
- */
+ #[Route(path: '/api/_action/unzer-payment/register-webhooks', name: 'api.action.unzer.webhooks.register', methods: ['POST'])]
public function registerWebhooks(RequestDataBag $dataBag): JsonResponse
{
/** @var DataBag $selection */
@@ -138,10 +124,7 @@ public function registerWebhooks(RequestDataBag $dataBag): JsonResponse
);
}
- /**
- * @Route("/api/_action/unzer-payment/clear-webhooks", name="api.action.unzer.webhooks.clear", methods={"POST"})
- * @Route("/api/v{version}/_action/unzer-payment/clear-webhooks", name="api.action.unzer.webhooks.clear.version", methods={"POST"})
- */
+ #[Route(path: '/api/_action/unzer-payment/clear-webhooks', name: 'api.action.unzer.webhooks.clear', methods: ['POST'])]
public function clearWebhooks(RequestDataBag $dataBag): JsonResponse
{
/** @var DataBag $selection */
@@ -162,10 +145,7 @@ public function clearWebhooks(RequestDataBag $dataBag): JsonResponse
);
}
- /**
- * @Route("/api/_action/unzer-payment/get-webhooks", name="api.action.unzer.webhooks.get", methods={"POST"})
- * @Route("/api/v{version}/_action/unzer-payment/get-webhooks", name="api.action.unzer.webhooks.get.version", methods={"POST"})
- */
+ #[Route(path: '/api/_action/unzer-payment/get-webhooks', name: 'api.action.unzer.webhooks.get', methods: ['POST'])]
public function getWebhooks(RequestDataBag $dataBag): JsonResponse
{
if (!$dataBag->has('privateKey') || empty($dataBag->get('privateKey'))) {
diff --git a/src/Controllers/Administration/UnzerPaymentTransactionController.php b/src/Controllers/Administration/UnzerPaymentTransactionController.php
index b25c0a18..14df51fd 100644
--- a/src/Controllers/Administration/UnzerPaymentTransactionController.php
+++ b/src/Controllers/Administration/UnzerPaymentTransactionController.php
@@ -8,11 +8,10 @@
use Shopware\Core\Checkout\Order\Aggregate\OrderTransaction\OrderTransactionEntity;
use Shopware\Core\Checkout\Payment\Exception\InvalidTransactionException;
use Shopware\Core\Framework\Context;
-use Shopware\Core\Framework\Routing\Annotation\RouteScope;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response;
-use Symfony\Component\Routing\Annotation\Route;
+use Symfony\Component\Routing\Attribute\Route;
use UnzerPayment6\Components\BackwardsCompatibility\InvoiceGenerator;
use UnzerPayment6\Components\BasketConverter\BasketConverterInterface;
use UnzerPayment6\Components\CancelService\CancelServiceInterface;
@@ -25,11 +24,7 @@
use UnzerSDK\Exceptions\UnzerApiException;
use UnzerSDK\Resources\TransactionTypes\Charge;
-/**
- * @RouteScope(scopes={"api"})
- *
- * @Route(defaults={"_routeScope": {"api"}})
- */
+#[Route(defaults: ['_routeScope' => ['api']])]
class UnzerPaymentTransactionController extends AbstractController
{
/**
@@ -82,10 +77,7 @@ public function __construct(
$this->logger = $logger;
}
- /**
- * @Route("/api/_action/unzer-payment/transaction/{orderTransactionId}/details", name="api.action.unzer.transaction.details", methods={"GET"})
- * @Route("/api/v{version}/_action/unzer-payment/transaction/{orderTransactionId}/details", name="api.action.unzer.transaction.details.version", methods={"GET"})
- */
+ #[Route(path: '/api/_action/unzer-payment/transaction/{orderTransactionId}/details', name: 'api.action.unzer.transaction.details', methods: ['GET'])]
public function fetchTransactionDetails(string $orderTransactionId, Context $context): JsonResponse
{
$transaction = $this->getOrderTransaction($orderTransactionId, $context);
@@ -133,10 +125,8 @@ public function fetchTransactionDetails(string $orderTransactionId, Context $con
return new JsonResponse($data);
}
- /**
- * @Route("/api/_action/unzer-payment/transaction/{orderTransactionId}/charge/{amount}", name="api.action.unzer.transaction.charge", methods={"GET"})
- * @Route("/api/v{version}/_action/unzer-payment/transaction/{orderTransactionId}/charge/{amount}", name="api.action.unzer.transaction.charge.version", methods={"GET"})
- */
+ // TODO: evaluate if GET is the correct method here
+ #[Route(path: '/api/_action/unzer-payment/transaction/{orderTransactionId}/charge/{amount}', name: 'api.action.unzer.transaction.charge', methods: ['GET'])]
public function chargeTransaction(string $orderTransactionId, float $amount, Context $context): JsonResponse
{
$transaction = $this->getOrderTransaction($orderTransactionId, $context);
@@ -189,12 +179,9 @@ public function chargeTransaction(string $orderTransactionId, float $amount, Con
return new JsonResponse(['status' => true]);
}
- /**
- * @Route("/api/_action/unzer-payment/transaction/{orderTransactionId}/refund/{chargeId}/{amount}", name="api.action.unzer.transaction.refund", methods={"GET"})
- * @Route("/api/_action/unzer-payment/transaction/{orderTransactionId}/refund/{chargeId}/{amount}/{reasonCode}", name="api.action.unzer.transaction.refund.reason", methods={"GET"})
- * @Route("/api/v{version}/_action/unzer-payment/transaction/{orderTransactionId}/refund/{chargeId}/{amount}", name="api.action.unzer.transaction.refund.version", methods={"GET"})
- * @Route("/api/v{version}/_action/unzer-payment/transaction/{orderTransactionId}/refund/{chargeId}/{amount}/{reasonCode}", name="api.action.unzer.transaction.refund.version.reason", methods={"GET"})
- */
+ // TODO: evaluate if GET is the correct method here
+ #[Route(path: '/api/_action/unzer-payment/transaction/{orderTransactionId}/refund/{chargeId}/{amount}', name: 'api.action.unzer.transaction.refund', methods: ['GET'])]
+ #[Route(path: '/api/_action/unzer-payment/transaction/{orderTransactionId}/refund/{chargeId}/{amount}/{reasonCode}', name: 'api.action.unzer.transaction.refund.reason', methods: ['GET'])]
public function refundTransaction(string $orderTransactionId, string $chargeId, float $amount, ?string $reasonCode, Context $context): JsonResponse
{
try {
@@ -228,10 +215,8 @@ public function refundTransaction(string $orderTransactionId, string $chargeId,
return new JsonResponse(['status' => true]);
}
- /**
- * @Route("/api/_action/unzer-payment/transaction/{orderTransactionId}/cancel/{authorizationId}/{amount}", name="api.action.unzer.transaction.cancel", methods={"GET"})
- * @Route("/api/v{version}/_action/unzer-payment/transaction/{orderTransactionId}/cancel/{authorizationId}/{amount}", name="api.action.unzer.transaction.cancel.version", methods={"GET"})
- */
+ // TODO: evaluate if GET is the correct method here
+ #[Route(path: '/api/_action/unzer-payment/transaction/{orderTransactionId}/cancel/{authorizationId}/{amount}', name: 'api.action.unzer.transaction.cancel', methods: ['GET'])]
public function cancelTransaction(string $orderTransactionId, string $authorizationId, float $amount, Context $context): JsonResponse
{
try {
@@ -265,10 +250,8 @@ public function cancelTransaction(string $orderTransactionId, string $authorizat
return new JsonResponse(['status' => true]);
}
- /**
- * @Route("/api/_action/unzer-payment/transaction/{orderTransactionId}/ship", name="api.action.unzer.transaction.ship", methods={"GET"})
- * @Route("/api/v{version}/_action/unzer-payment/transaction/{orderTransactionId}/ship", name="api.action.unzer.transaction.ship.version", methods={"GET"})
- */
+ // TODO: evaluate if GET is the correct method here
+ #[Route(path: '/api/_action/unzer-payment/transaction/{orderTransactionId}/ship', name: 'api.action.unzer.transaction.ship', methods: ['GET'])]
public function shipTransaction(string $orderTransactionId, Context $context): JsonResponse
{
try {
diff --git a/src/Controllers/Storefront/UnzerCheckoutController.php b/src/Controllers/Storefront/UnzerCheckoutController.php
index 94650fd0..5af8bfbd 100644
--- a/src/Controllers/Storefront/UnzerCheckoutController.php
+++ b/src/Controllers/Storefront/UnzerCheckoutController.php
@@ -4,7 +4,6 @@
namespace UnzerPayment6\Controllers\Storefront;
-use Shopware\Core\Framework\Routing\Annotation\RouteScope;
use Shopware\Core\Framework\Validation\DataBag\RequestDataBag;
use Shopware\Core\System\SalesChannel\SalesChannelContext;
use Shopware\Storefront\Controller\CheckoutController;
@@ -12,11 +11,10 @@
use Shopware\Storefront\Page\Checkout\Finish\CheckoutFinishPageLoader;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\Routing\Attribute\Route;
use UnzerPayment6\Components\PaymentHandler\Exception\UnzerPaymentProcessException;
-/**
- * @RouteScope(scopes={"storefront"})
- */
+#[Route(defaults: ['_routeScope' => ['storefront']])]
class UnzerCheckoutController extends CheckoutController
{
/**
diff --git a/src/Controllers/Storefront/UnzerExpressCheckoutController.php b/src/Controllers/Storefront/UnzerExpressCheckoutController.php
index 564f8342..5b5133c8 100644
--- a/src/Controllers/Storefront/UnzerExpressCheckoutController.php
+++ b/src/Controllers/Storefront/UnzerExpressCheckoutController.php
@@ -5,7 +5,6 @@
namespace UnzerPayment6\Controllers\Storefront;
use Psr\Log\LoggerInterface;
-use Shopware\Core\Framework\Routing\Annotation\RouteScope;
use Shopware\Core\System\SalesChannel\SalesChannelContext;
use Shopware\Storefront\Controller\StorefrontController;
use Symfony\Component\HttpFoundation\JsonResponse;
@@ -27,11 +26,7 @@
use UnzerSDK\Resources\TransactionTypes\Authorization;
use UnzerSDK\Resources\TransactionTypes\Charge;
-/**
- * @RouteScope(scopes={"storefront"})
- *
- * @Route(defaults={"_routeScope": {"storefront"}})
- */
+#[Route(defaults: ['_routeScope' => ['storefront']])]
class UnzerExpressCheckoutController extends StorefrontController
{
/**
@@ -45,9 +40,7 @@ public function __construct(
) {
}
- /**
- * @Route("/unzer/paypal-express", name="frontend.unzer.paypal-express", methods={"POST", "GET"}, defaults={"csrf_protected": false})
- */
+ #[Route(path: '/unzer/paypal-express', name: 'frontend.unzer.paypal-express', defaults: ['csrf_protected' => false], methods: ['POST', 'GET'])]
public function paypalExpress(Request $request, SalesChannelContext $salesChannelContext): Response
{
$paymentTypeId = $request->get('paymentTypeId');
@@ -100,9 +93,7 @@ public function paypalExpress(Request $request, SalesChannelContext $salesChanne
]);
}
- /**
- * @Route("/unzer/paypal-express-return", name="frontend.unzer.paypal-express-return", methods={"POST", "GET"}, defaults={"csrf_protected": false})
- */
+ #[Route(path: '/unzer/paypal-express-return', name: 'frontend.unzer.paypal-express-return', defaults: ['csrf_protected' => false], methods: ['POST', 'GET'])]
public function paypalExpressReturn(Request $request, SalesChannelContext $salesChannelContext): Response
{
$paymentId = $request->getSession()->get('paypal-express-checkout-payment-id');
@@ -128,9 +119,7 @@ public function paypalExpressReturn(Request $request, SalesChannelContext $sales
return $this->redirectToRoute('frontend.checkout.confirm.page', ['isExpressCheckout' => 'true']);
}
- /**
- * @Route("/unzer/google-pay-express", name="frontend.unzer.google-express", methods={"POST", "GET"}, defaults={"csrf_protected": false})
- */
+ #[Route(path: '/unzer/google-pay-express', name: 'frontend.unzer.google-express', defaults: ['csrf_protected' => false], methods: ['POST', 'GET'])]
public function googleExpress(Request $request, SalesChannelContext $salesChannelContext): Response
{
$paymentTypeId = $request->get('paymentTypeId');
@@ -150,9 +139,7 @@ public function googleExpress(Request $request, SalesChannelContext $salesChanne
]);
}
- /**
- * @Route("/unzer/applepay-express", name="frontend.unzer.applepay-express", methods={"POST", "GET"}, defaults={"csrf_protected": false})
- */
+ #[Route(path: '/unzer/applepay-express', name: 'frontend.unzer.applepay-express', defaults: ['csrf_protected' => false], methods: ['POST', 'GET'])]
public function applepayExpress(Request $request, SalesChannelContext $salesChannelContext): Response
{
$paymentTypeId = $request->get('paymentTypeId');
diff --git a/src/Controllers/Storefront/UnzerPaymentDeviceController.php b/src/Controllers/Storefront/UnzerPaymentDeviceController.php
index 3e7f7a2b..06a46eec 100644
--- a/src/Controllers/Storefront/UnzerPaymentDeviceController.php
+++ b/src/Controllers/Storefront/UnzerPaymentDeviceController.php
@@ -4,19 +4,14 @@
namespace UnzerPayment6\Controllers\Storefront;
-use Shopware\Core\Framework\Routing\Annotation\RouteScope;
use Shopware\Core\System\SalesChannel\SalesChannelContext;
use Shopware\Storefront\Controller\StorefrontController;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
-use Symfony\Component\Routing\Annotation\Route;
+use Symfony\Component\Routing\Attribute\Route;
use UnzerPayment6\DataAbstractionLayer\Repository\PaymentDevice\UnzerPaymentDeviceRepositoryInterface;
-/**
- * @RouteScope(scopes={"storefront"})
- *
- * @Route(defaults={"_routeScope": {"storefront"}})
- */
+#[Route(defaults: ['_routeScope' => ['storefront']])]
class UnzerPaymentDeviceController extends StorefrontController
{
/**
@@ -29,9 +24,8 @@ public function __construct(UnzerPaymentDeviceRepositoryInterface $deviceReposit
$this->deviceRepository = $deviceRepository;
}
- /**
- * @Route("/unzer/deleteDevice", name="frontend.unzer.device.delete", methods={"GET"})
- */
+ // TODO: evaluate if GET is the correct method for this route
+ #[Route(path: '/unzer/deleteDevice', name: 'frontend.unzer.device.delete', methods: ['GET'])]
public function deleteDevice(Request $request, SalesChannelContext $salesChannelContext): RedirectResponse
{
if (!$salesChannelContext->getCustomer()) {
diff --git a/src/Controllers/Storefront/UnzerPaymentWebhookController.php b/src/Controllers/Storefront/UnzerPaymentWebhookController.php
index 3019e132..23720ee5 100644
--- a/src/Controllers/Storefront/UnzerPaymentWebhookController.php
+++ b/src/Controllers/Storefront/UnzerPaymentWebhookController.php
@@ -5,23 +5,18 @@
namespace UnzerPayment6\Controllers\Storefront;
use Psr\Log\LoggerInterface;
-use Shopware\Core\Framework\Routing\Annotation\RouteScope;
use Shopware\Core\System\SalesChannel\SalesChannelContext;
use Shopware\Storefront\Controller\StorefrontController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
-use Symfony\Component\Routing\Annotation\Route;
+use Symfony\Component\Routing\Attribute\Route;
use UnzerPayment6\Components\ConfigReader\ConfigReader;
use UnzerPayment6\Components\ConfigReader\ConfigReaderInterface;
use UnzerPayment6\Components\Struct\Configuration;
use UnzerPayment6\Components\Struct\Webhook;
use UnzerPayment6\Components\WebhookHandler\WebhookHandlerInterface;
-/**
- * @RouteScope(scopes={"storefront"})
- *
- * @Route(defaults={"_routeScope": {"storefront"}})
- */
+#[Route(defaults: ['_routeScope' => ['storefront']])]
class UnzerPaymentWebhookController extends StorefrontController
{
/**
@@ -46,9 +41,7 @@ public function __construct(\Traversable $handlers, ConfigReaderInterface $confi
$this->logger = $logger;
}
- /**
- * @Route("/unzer/webhook", name="frontend.unzer.webhook.execute", methods={"POST", "GET"}, defaults={"csrf_protected": false})
- */
+ #[Route(path: '/unzer/webhook', name: 'frontend.unzer.webhook.execute', defaults: ['csrf_protected' => false], methods: ['POST', 'GET'])]
public function execute(Request $request, SalesChannelContext $salesChannelContext): Response
{
/** @var false|string $requestContent */
diff --git a/src/Installer/PaymentInstaller.php b/src/Installer/PaymentInstaller.php
index b164bf60..8d8aba73 100755
--- a/src/Installer/PaymentInstaller.php
+++ b/src/Installer/PaymentInstaller.php
@@ -529,10 +529,10 @@ private function renameIdeal(Context $context): void
foreach ($existingPaymentMethod->getTranslations()->getElements() as $uniqueId => $translation) {
$newName = null;
$newDescription = null;
- if (stripos($translation->getName(), 'wero') === false) {
+ if ($translation->getName() !== null && stripos($translation->getName(), 'wero') === false) {
$newName = str_replace('iDEAL', 'iDEAL | Wero', $translation->getName());
}
- if (stripos($translation->getDescription(), 'wero') === false) {
+ if ($translation->getDescription() !== null && stripos($translation->getDescription(), 'wero') === false) {
$newDescription = str_replace('iDEAL', 'iDEAL | Wero', $translation->getDescription());
}
diff --git a/src/Resources/config/routes.xml b/src/Resources/config/routes.xml
index 0087097c..9cb32e0d 100755
--- a/src/Resources/config/routes.xml
+++ b/src/Resources/config/routes.xml
@@ -3,6 +3,6 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/routing
http://symfony.com/schema/routing/routing-1.0.xsd">
-
-
+
+
diff --git a/src/Resources/views/storefront/component/unzer/base/unzer-library.html.twig b/src/Resources/views/storefront/component/unzer/base/unzer-library.html.twig
index 0c4ff6db..e48c4027 100644
--- a/src/Resources/views/storefront/component/unzer/base/unzer-library.html.twig
+++ b/src/Resources/views/storefront/component/unzer/base/unzer-library.html.twig
@@ -1,4 +1,3 @@
{% block unzer_paymentbase_js_library %}
- {# #}
-
+
{% endblock %}
diff --git a/src/UnzerPayment6.php b/src/UnzerPayment6.php
index 8d79f631..704e97c7 100755
--- a/src/UnzerPayment6.php
+++ b/src/UnzerPayment6.php
@@ -21,7 +21,6 @@
use UnzerPayment6\Installer\CustomFieldInstaller;
use UnzerPayment6\Installer\PaymentInstaller;
-include_once 'Components/BackwardsCompatibility/RouteScope.php';
include_once 'Components/BackwardsCompatibility/InvoiceGenerator.php';
if (file_exists(__DIR__ . '/../vendor/autoload.php')) {