diff --git a/Classes/Controller/Order/PaymentController.php b/Classes/Controller/Order/PaymentController.php index d547d52..2285034 100644 --- a/Classes/Controller/Order/PaymentController.php +++ b/Classes/Controller/Order/PaymentController.php @@ -183,11 +183,10 @@ public function cancelAction(): void } } - public function notifyAction(): void + public function notifyAction() { if ($this->request->getMethod() !== 'POST') { - $this->response->setStatus(405); - exit(); + return $this->htmlResponse()->withStatus(405, 'Method not allowed.'); } $postData = GeneralUtility::_POST(); @@ -208,15 +207,13 @@ public function notifyAction(): void $cartSHash = $postData['custom']; if (empty($cartSHash)) { - $this->response->setStatus(403); - exit(); + return $this->htmlResponse()->withStatus(403, 'Not allowed.'); } $this->loadCartByHash($this->request->getArgument('hash')); if ($this->cart === null) { - $this->response->setStatus(404); - exit(); + return $this->htmlResponse()->withStatus(404, 'Page / Cart not found.'); } $orderItem = $this->cart->getOrderItem(); @@ -231,8 +228,7 @@ public function notifyAction(): void $this->eventDispatcher->dispatch($notifyEvent); } - $this->response->setStatus(200); - exit(); + return $this->htmlResponse()->withStatus(200); } protected function restoreCartSession(): void diff --git a/Classes/EventListener/Order/Payment/ClearCart.php b/Classes/EventListener/Order/Payment/ClearCart.php index 25f95a6..dc1ef5f 100644 --- a/Classes/EventListener/Order/Payment/ClearCart.php +++ b/Classes/EventListener/Order/Payment/ClearCart.php @@ -10,9 +10,23 @@ */ use Extcode\Cart\Event\Order\EventInterface; +use Extcode\Cart\EventListener\Order\Finish\ClearCart as FinishClearCart; +use Extcode\Cart\Service\SessionHandler; +use Extcode\Cart\Utility\CartUtility; +use Extcode\Cart\Utility\ParserUtility; -class ClearCart extends \Extcode\Cart\EventListener\ProcessOrderCreate\ClearCart +class ClearCart extends FinishClearCart { + public function __construct( + CartUtility $cartUtility, + ParserUtility $parserUtility, + SessionHandler $sessionHandler + ) { + $this->cartUtility = $cartUtility; + $this->parserUtility = $parserUtility; + $this->sessionHandler = $sessionHandler; + } + public function __invoke(EventInterface $event): void { $orderItem = $event->getOrderItem(); diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml index 95766b8..dc17ee4 100644 --- a/Configuration/Services.yaml +++ b/Configuration/Services.yaml @@ -17,6 +17,10 @@ services: $paymentRepository: '@Extcode\Cart\Domain\Repository\Order\PaymentRepository' Extcode\CartPaypal\EventListener\Order\Payment\ClearCart: + arguments: + $cartUtility: '@Extcode\Cart\Utility\CartUtility' + $parserUtility: '@Extcode\Cart\Utility\ParserUtility' + $sessionHandler: '@Extcode\Cart\Service\SessionHandler' tags: - name: event.listener identifier: 'cart-paypal--order--payment--clear-cart' @@ -35,7 +39,7 @@ services: event: Extcode\Cart\Event\Order\PaymentEvent Extcode\CartPaypal\EventListener\Order\Notify\Email: - class: 'Extcode\Cart\EventListener\ProcessOrderCreate\Email' + class: 'Extcode\Cart\EventListener\Order\Finish\Email' tags: - name: event.listener identifier: 'cart-paypal--order--notify--email' diff --git a/Configuration/TCA/Overrides/sys_template.php b/Configuration/TCA/Overrides/sys_template.php index f3e6709..611f5a9 100644 --- a/Configuration/TCA/Overrides/sys_template.php +++ b/Configuration/TCA/Overrides/sys_template.php @@ -1,5 +1,5 @@ + + + + + +
+ +
+
+
diff --git a/composer.json b/composer.json index 06c69fb..0e3cb3c 100644 --- a/composer.json +++ b/composer.json @@ -12,6 +12,7 @@ "PayPal", "cart" ], + "version": "5.1.0", "authors": [ { "name": "Daniel Gohlke", @@ -41,10 +42,10 @@ "require": { "php": ">=7.2.0 <7.5", "ext-curl": "*", - "typo3/cms-core": "^10.4", - "typo3/cms-extbase": "^10.4", - "typo3/cms-frontend": "^10.4", - "extcode/cart": "^7.4" + "typo3/cms-core": "^11.5", + "typo3/cms-extbase": "^11.5", + "typo3/cms-frontend": "^11.5", + "extcode/cart": "^8.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^2.14", diff --git a/ext_localconf.php b/ext_localconf.php index a582ece..4baa585 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -1,6 +1,6 @@