From e1359f6dbc8b568a34a50b82fe30222f52db2ff6 Mon Sep 17 00:00:00 2001 From: Vitalij Mik Date: Mon, 22 Apr 2024 13:54:29 +0200 Subject: [PATCH] NTR: fix checkout for 6.4 --- polyfill/Shopware/Core/Checkout/Payment/PaymentException.php | 4 ++-- src/Handler/PaymentHandler.php | 4 +++- .../admin/refund-manager/RefundManagerRepository.js | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/polyfill/Shopware/Core/Checkout/Payment/PaymentException.php b/polyfill/Shopware/Core/Checkout/Payment/PaymentException.php index 566a68708..d25a40698 100644 --- a/polyfill/Shopware/Core/Checkout/Payment/PaymentException.php +++ b/polyfill/Shopware/Core/Checkout/Payment/PaymentException.php @@ -13,12 +13,12 @@ class PaymentException { - public static function asyncFinalizeInterrupted(string $orderTransactionId, string $errorMessage, ?\Throwable $e = null): self + public static function asyncFinalizeInterrupted(string $orderTransactionId, string $errorMessage, ?\Throwable $e = null): AsyncPaymentFinalizeException { return new AsyncPaymentFinalizeException($orderTransactionId, $errorMessage, $e); } - public static function customerCanceled(string $orderTransactionId, string $additionalInformation, ?\Throwable $e = null): self + public static function customerCanceled(string $orderTransactionId, string $additionalInformation, ?\Throwable $e = null): CustomerCanceledAsyncPaymentException { return new CustomerCanceledAsyncPaymentException($orderTransactionId, $additionalInformation, $e); } diff --git a/src/Handler/PaymentHandler.php b/src/Handler/PaymentHandler.php index 62189f776..6c3f5b706 100644 --- a/src/Handler/PaymentHandler.php +++ b/src/Handler/PaymentHandler.php @@ -17,6 +17,8 @@ use Shopware\Core\Checkout\Order\OrderEntity; use Shopware\Core\Checkout\Payment\Cart\AsyncPaymentTransactionStruct; use Shopware\Core\Checkout\Payment\Cart\PaymentHandler\AsynchronousPaymentHandlerInterface; +use Shopware\Core\Checkout\Payment\Exception\AsyncPaymentFinalizeException; +use Shopware\Core\Checkout\Payment\Exception\CustomerCanceledAsyncPaymentException; use Shopware\Core\Checkout\Payment\PaymentException; use Shopware\Core\Framework\Validation\DataBag\RequestDataBag; use Shopware\Core\System\SalesChannel\SalesChannelContext; @@ -173,7 +175,7 @@ public function finalize(AsyncPaymentTransactionStruct $transaction, Request $re try { $this->finalizeFacade->finalize($transaction, $salesChannelContext); /** @phpstan-ignore-next-line */ - } catch (PaymentException $ex) { + } catch (AsyncPaymentFinalizeException|CustomerCanceledAsyncPaymentException|PaymentException $ex) { $this->logger->error( 'Error when finalizing order ' . $transaction->getOrder()->getOrderNumber() . ', Mollie ID: ' . $molliedID . ', ' . $ex->getMessage() ); diff --git a/tests/Cypress/cypress/support/repositories/admin/refund-manager/RefundManagerRepository.js b/tests/Cypress/cypress/support/repositories/admin/refund-manager/RefundManagerRepository.js index 863907c39..b8e47d7fc 100644 --- a/tests/Cypress/cypress/support/repositories/admin/refund-manager/RefundManagerRepository.js +++ b/tests/Cypress/cypress/support/repositories/admin/refund-manager/RefundManagerRepository.js @@ -122,7 +122,7 @@ export default class RefundManagerRepository { } /** - * + * * @returns {Cypress.Chainable>} */ getFirstRefundQuantityInput(){