diff --git a/Classes/Controller/Order/PaymentController.php b/Classes/Controller/Order/PaymentController.php index 5b4be47..7793c05 100644 --- a/Classes/Controller/Order/PaymentController.php +++ b/Classes/Controller/Order/PaymentController.php @@ -70,6 +70,16 @@ class PaymentController extends ActionController */ protected $cartConf = []; + /** + * @var string|bool + */ + protected $curlResult; + + /** + * @var array + */ + protected $curlResults; + /** * @var array */ diff --git a/Classes/EventListener/Order/Payment/ProviderRedirect.php b/Classes/EventListener/Order/Payment/ProviderRedirect.php index 78c7966..872fcb9 100644 --- a/Classes/EventListener/Order/Payment/ProviderRedirect.php +++ b/Classes/EventListener/Order/Payment/ProviderRedirect.php @@ -12,6 +12,7 @@ use Extcode\Cart\Domain\Model\Cart; use Extcode\Cart\Domain\Model\Cart\Cart as CartCart; use Extcode\Cart\Domain\Model\Cart\CartCoupon; +use Extcode\Cart\Domain\Model\Cart\CartCouponPercentage; use Extcode\Cart\Domain\Model\Order\Item as OrderItem; use Extcode\Cart\Domain\Repository\CartRepository; use Extcode\Cart\Event\Order\PaymentEvent; @@ -229,7 +230,12 @@ protected function addEachCouponFromCartToQuery(): void */ foreach ($this->cart->getCoupons() as $cartCoupon) { if ($cartCoupon->getIsUseable()) { - $discount += $cartCoupon->getDiscount(); + // A.K.: Differentiate between percentage and fixed discount + if ($cartCoupon instanceof CartCouponPercentage) { + $discount += (float)($this->orderItem->getGross() * $cartCoupon->getDiscount()); + } else { + $discount += $cartCoupon->getDiscount(); + } } } diff --git a/composer.json b/composer.json index 36f6c63..2b5507a 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,11 @@ }, "config": { "bin-dir": ".build/bin", - "vendor-dir": ".build/vendor" + "vendor-dir": ".build/vendor", + "allow-plugins": { + "typo3/cms-composer-installers": true, + "typo3/class-alias-loader": true + } }, "extra": { "typo3/cms": { @@ -40,7 +44,7 @@ } }, "require": { - "php": ">=7.2.0 <8.2", + "php": ">=7.4.0 <8.2", "ext-curl": "*", "typo3/cms-core": "^11.5", "typo3/cms-extbase": "^11.5", @@ -48,7 +52,7 @@ "extcode/cart": "^8.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.14", + "friendsofphp/php-cs-fixer": "^3.14", "helmich/typo3-typoscript-lint": "^2.0", "overtrue/phplint": "^1.1" }, diff --git a/ext_emconf.php b/ext_emconf.php index 827542c..d5d768f 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -11,7 +11,7 @@ 'version' => '5.0.0', 'constraints' => [ 'depends' => [ - 'typo3' => '10.4.0-10.4.99', + 'typo3' => '11.5.0-11.5.99', 'cart' => '7.4.0', ], 'conflicts' => [],