/**
* @param DiscountCompositionItem[] $items
*/
public function buildCompositionPayload(array
$items): array
{ $payloadItems =
[];
foreach ($items as $item) { $payloadItems[] =
[ 'id' =>
$item->
getId(),
'quantity' =>
$item->
getQuantity(),
'discount' =>
$item->
getDiscountValue(),
];
} return $payloadItems;
} /**
* If our discount price is greater than our actual cart price, we have to
* adjust the calculated discount price.
* Due to that, we also have to adjust our composition data to match the new target price.
*/