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_de-DE.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG_en-GB.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
22 changes: 0 additions & 22 deletions src/Components/BackwardsCompatibility/Filesystem.php

This file was deleted.

24 changes: 0 additions & 24 deletions src/Components/BackwardsCompatibility/RouteScope.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,20 @@
namespace UnzerPayment6\Controllers\Administration;

use Psr\Log\LoggerInterface;
use Shopware\Core\Framework\Routing\Annotation\RouteScope;
use Shopware\Core\Framework\Validation\DataBag\DataBag;
use Shopware\Core\Framework\Validation\DataBag\RequestDataBag;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
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\ClientFactory\ClientFactoryInterface;
use UnzerPayment6\Components\ConfigReader\ConfigReader;
use UnzerPayment6\Components\PaymentHandler\UnzerGooglePayPaymentHandler;
use UnzerPayment6\Components\WebhookRegistrator\WebhookRegistratorInterface;
use UnzerSDK\Exceptions\UnzerApiException;

/**
* @RouteScope(scopes={"api"})
*
* @Route(defaults={"_routeScope": {"api"}})
*/
#[Route(defaults: ['_routeScope' => ['api']])]
class UnzerPaymentConfigurationController extends AbstractController
{
/**
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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 {
Expand All @@ -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 */
Expand All @@ -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 */
Expand All @@ -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'))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
{
/**
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
6 changes: 2 additions & 4 deletions src/Controllers/Storefront/UnzerCheckoutController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,17 @@

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;
use Shopware\Storefront\Controller\StorefrontController;
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
{
/**
Expand Down
23 changes: 5 additions & 18 deletions src/Controllers/Storefront/UnzerExpressCheckoutController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
{
/**
Expand All @@ -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');
Expand Down Expand Up @@ -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');
Expand All @@ -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');
Expand All @@ -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');
Expand Down
14 changes: 4 additions & 10 deletions src/Controllers/Storefront/UnzerPaymentDeviceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
/**
Expand All @@ -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()) {
Expand Down
Loading
Loading