Skip to content

Commit

Permalink
add comment why we do not submit concatenated description for multipl…
Browse files Browse the repository at this point in the history
…e discounts
  • Loading branch information
rommelfreddy committed Mar 29, 2022
1 parent b8146c8 commit 6762924
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Component/Mapper/BasketArrayBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6762924

Please sign in to comment.