/**
* @return array<string, mixed>
*/
private function getRequestOptions(SourcedPayloadInterface
$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) { if ($payload instanceof PaymentPayloadInterface
) { throw PaymentException::
asyncProcessInterrupted($payload->
getOrderTransaction()->
getId(), \
sprintf('Empty payload, got: %s',
var_export($jsonPayload, true
)));
} throw PaymentException::
validatePreparedPaymentInterrupted(\
sprintf('Empty payload, got: %s',
var_export($jsonPayload, true
)));
} $secret =
$app->
getAppSecret();
if ($secret === null
) { throw AppException::
registrationFailed($app->
getName(), 'App secret is missing'
);
} return [