$payload['meta'
] =
[ 'timestamp'
=> (new \
DateTime())->
getTimestamp(),
'reference' => Uuid::
randomHex(),
'language' =>
$context->
getLanguageId(),
];
$appSecret =
$action->
getAppSecret();
if (!
$appSecret ||
str_starts_with($action->
getTargetUrl(), '/'
)) { $content =
$this->
executeSubRequest($action);
} else { $content =
$this->
executeHttpRequest($action,
$context,
$payload,
$appSecret);
} if (empty($content)) { return new JsonResponse();
} $content =
json_decode($content, true, 512, \JSON_THROW_ON_ERROR
);
if (!\
array_key_exists('actionType',
$content) || !\
array_key_exists('payload',
$content)) { throw AppException::
actionButtonProcessException($action->
getActionId(), 'Invalid app response'
);
}