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/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', ], 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",