CodeExplorer addPaymentChangeable example
$response =
new OrderRouteResponse($orderResult);
if ($request->
get('checkPromotion'
) === true
) { foreach ($orders as $order) { $promotions =
$this->
getActivePromotions($order,
$context);
$changeable = true;
foreach ($promotions as $promotion) { $changeable =
$this->
checkPromotion($promotion);
if ($changeable === true
) { break;
} } $response->
addPaymentChangeable([$order->
getId() =>
$changeable]);
} } return $response;
} private function getActivePromotions(OrderEntity
$order, SalesChannelContext
$context): PromotionCollection
{ $promotionIds =
[];
foreach ($order->
getLineItems() ??
[] as $lineItem) { $payload =
$lineItem->
getPayload();