Skip to content

Commit

Permalink
Merge branch '5.x' into typo3-v11-php-81
Browse files Browse the repository at this point in the history
  • Loading branch information
krausandre committed Dec 10, 2023
2 parents f0e1f7f + 89d3def commit 433179d
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
10 changes: 10 additions & 0 deletions Classes/Controller/Order/PaymentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ class PaymentController extends ActionController
*/
protected $cartConf = [];

/**
* @var string|bool
*/
protected $curlResult;

/**
* @var array
*/
protected $curlResults;

/**
* @var array
*/
Expand Down
8 changes: 7 additions & 1 deletion Classes/EventListener/Order/Payment/ProviderRedirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}
}
}

Expand Down
10 changes: 7 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -40,15 +44,15 @@
}
},
"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",
"typo3/cms-frontend": "^11.5",
"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"
},
Expand Down
2 changes: 1 addition & 1 deletion ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => [],
Expand Down

0 comments on commit 433179d

Please sign in to comment.