$timestamp =
time();
$payload['timestamp'
] =
$timestamp;
/** @var string $jsonPayload */
$jsonPayload =
json_encode($payload, \JSON_THROW_ON_ERROR
);
$headers =
['Content-Type' => 'application/json',
'sw-version' =>
$shopwareVersion,
];
// LanguageId and UserLocale will be required from 6.5.0 onward
if ($message->
getLanguageId() &&
$message->
getUserLocale()) { $headers =
array_merge($headers,
[AuthMiddleware::SHOPWARE_CONTEXT_LANGUAGE =>
$message->
getLanguageId(), AuthMiddleware::SHOPWARE_USER_LANGUAGE =>
$message->
getUserLocale()]);
} $requestContent =
[ 'headers' =>
$headers,
'body' =>
$jsonPayload,
'connect_timeout' => self::CONNECT_TIMEOUT,
'timeout' => self::TIMEOUT,
];
if ($message->
getSecret()) {