From 6762924789d3b7f944f2bc39af1ab5e6eb48dcc1 Mon Sep 17 00:00:00 2001 From: Frederik Rommel Date: Wed, 2 Mar 2022 16:46:09 +0100 Subject: [PATCH] add comment why we do not submit concatenated description for multiple discounts --- Component/Mapper/BasketArrayBuilder.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Component/Mapper/BasketArrayBuilder.php b/Component/Mapper/BasketArrayBuilder.php index 6dfdf060..0931997a 100644 --- a/Component/Mapper/BasketArrayBuilder.php +++ b/Component/Mapper/BasketArrayBuilder.php @@ -241,6 +241,12 @@ public function addDiscountItem($item) throw new RuntimeException('the object must be a type of ' . Detail::class . ' or ' . PositionStruct::class); } + // we do combine the description of the discount, cause the description got always overridden on the gateway, + // on each request. So if you have multiple discounts and the discounts got marked as sent in different + // request, the final discount description will be the description of the last discount. + // This is the reason why wo not submit a concatenated description of all discounts. + // Last tickets to this: RATEPLUG-77 & RATEPLUG-224 + $this->basket['Discount']['Description'] = 'Rabatt'; // TODO translation $this->basket['Discount']['UnitPriceGross'] = isset($this->basket['Discount']['UnitPriceGross']) ? $this->basket['Discount']['UnitPriceGross'] + $price : $price; $this->basket['Discount']['TaxRate'] = $taxRate;