From 4a2d5b83e08a54022e8c8ee40ee4d6e54efa12e8 Mon Sep 17 00:00:00 2001 From: Daniel Gohlke Date: Sun, 22 Nov 2026 17:21:20 +0100 Subject: [PATCH 1/2] [TASK] Send order emails with the OrderMailSender in tests Since cart 12.4 sending the emails of an order with the MailHandler triggers a deprecation, which fails the functional tests. The tests enable the feature toggle cart.useNewOrderMailSender, so the emails are sent by the OrderMailSender. Co-Authored-By: Claude Opus 5.5 --- .../Controller/Order/AbstractPaymentControllerTestCase.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Tests/Functional/Controller/Order/AbstractPaymentControllerTestCase.php b/Tests/Functional/Controller/Order/AbstractPaymentControllerTestCase.php index ffaa220..425b5d0 100644 --- a/Tests/Functional/Controller/Order/AbstractPaymentControllerTestCase.php +++ b/Tests/Functional/Controller/Order/AbstractPaymentControllerTestCase.php @@ -53,6 +53,11 @@ abstract class AbstractPaymentControllerTestCase extends FunctionalTestCase 'enforceValidation' => false, ], ], + 'SYS' => [ + 'features' => [ + 'cart.useNewOrderMailSender' => true, + ], + ], 'MAIL' => [ 'transport' => 'null', ], From 9e288c6d53ee9cf7d9ccdc9a23775e0a4eea7ee7 Mon Sep 17 00:00:00 2001 From: Daniel Gohlke Date: Sun, 22 Nov 2026 17:05:02 +0100 Subject: [PATCH 2/2] [TASK] Use the payment status constants of cart The payment and transaction status is set with the constants of \Extcode\Cart\OrderStatus\PaymentStatus instead of plain strings. The constants are available since cart 12.4. Resolves: #40 Co-Authored-By: Claude Opus 5.5 --- Classes/Controller/Order/PaymentController.php | 9 +++++---- composer.json | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Classes/Controller/Order/PaymentController.php b/Classes/Controller/Order/PaymentController.php index 70bc9fd..c808e8c 100644 --- a/Classes/Controller/Order/PaymentController.php +++ b/Classes/Controller/Order/PaymentController.php @@ -17,6 +17,7 @@ use Extcode\Cart\Domain\Repository\CartRepository; use Extcode\Cart\Domain\Repository\Order\ItemRepository as OrderItemRepository; use Extcode\Cart\Domain\Repository\Order\PaymentRepository; +use Extcode\Cart\OrderStatus\PaymentStatus; use Extcode\Cart\Service\SessionHandler; use Extcode\CartGirosolution\Configuration\CredentialLoaderRegistry; use Extcode\CartGirosolution\Event\Order\CancelEvent; @@ -80,7 +81,7 @@ public function redirectAction(): ResponseInterface $notify = $this->getParsedNotify($clearingType); if ($notify->paymentSuccessful()) { - $dispatchEvent = $this->updatePaymentAndTransaction($notify, $orderItem, 'paid'); + $dispatchEvent = $this->updatePaymentAndTransaction($notify, $orderItem, PaymentStatus::PAID); if ($dispatchEvent) { $finishEvent = new FinishEvent($this->cart->getCart(), $orderItem, $this->cartPluginSettings); @@ -97,7 +98,7 @@ public function redirectAction(): ResponseInterface ); } - $dispatchEvent = $this->updatePaymentAndTransaction($notify, $orderItem, 'canceled'); + $dispatchEvent = $this->updatePaymentAndTransaction($notify, $orderItem, PaymentStatus::CANCELED); $this->restoreCartSession(); @@ -127,7 +128,7 @@ public function notifyAction(): ResponseInterface $notify = $this->getParsedNotify($clearingType); if ($notify->paymentSuccessful()) { - $dispatchEvent = $this->updatePaymentAndTransaction($notify, $orderItem, 'paid'); + $dispatchEvent = $this->updatePaymentAndTransaction($notify, $orderItem, PaymentStatus::PAID); if ($dispatchEvent) { $orderItem = $this->cart->getOrderItem(); @@ -135,7 +136,7 @@ public function notifyAction(): ResponseInterface $this->eventDispatcher->dispatch($finishEvent); } } else { - $dispatchEvent = $this->updatePaymentAndTransaction($notify, $orderItem, 'canceled'); + $dispatchEvent = $this->updatePaymentAndTransaction($notify, $orderItem, PaymentStatus::CANCELED); if ($dispatchEvent) { $orderItem = $this->cart->getOrderItem(); diff --git a/composer.json b/composer.json index e44b761..e1ddb86 100644 --- a/composer.json +++ b/composer.json @@ -51,7 +51,7 @@ }, "require": { "php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0", - "extcode/cart": "^12.0", + "extcode/cart": "^12.4", "girosolution/girocheckout-sdk": "^2.6", "typo3/cms-core": "^14.3", "typo3/cms-extbase": "^14.3",