/**
* @return array<string, mixed>
*/
private function getRequestOptions(TaxProviderPayload
$payload, AppEntity
$app, Context
$context): array
{ $payload->
setSource($this->helper->
buildSource($app,
$this->shopUrl
));
$encoded =
$this->helper->
encode($payload);
$jsonPayload = \
json_encode($encoded, \JSON_THROW_ON_ERROR
);
if (!
$jsonPayload) { throw new BadRequestHttpException(\
sprintf('Empty payload, got: %s', \
var_export($jsonPayload, true
)));
} $secret =
$app->
getAppSecret();
if (!
$secret) { throw AppException::
registrationFailed($app->
getName(), 'App secret is missing'
);
} return [ AuthMiddleware::APP_REQUEST_CONTEXT =>
$context,
AuthMiddleware::APP_REQUEST_TYPE =>
[