$currency =
$context->
getCurrency();
$data =
[ 'price' =>
$cart->
getPrice(),
'shippingCosts' =>
$cart->
getShippingCosts(),
'stateId' =>
$stateId,
'currencyId' =>
$currency->
getId(),
'currencyFactor' =>
$currency->
getFactor(),
'salesChannelId' =>
$context->
getSalesChannel()->
getId(),
'lineItems' =>
[],
'deliveries' =>
[],
'deepLinkCode' => Random::
getBase64UrlString(32
),
'customerComment' =>
$cart->
getCustomerComment(),
'affiliateCode' =>
$cart->
getAffiliateCode(),
'campaignCode' =>
$cart->
getCampaignCode(),
'source' =>
$cart->
getSource(),
];
if ($setOrderDate) { $data['orderDateTime'
] =
(new \
DateTimeImmutable())->
format(Defaults::STORAGE_DATE_TIME_FORMAT
);
} $data['itemRounding'
] =
json_decode(Json::
encode($context->
getItemRounding()), true, 512, \JSON_THROW_ON_ERROR
);