/**
* @return array<string, mixed>
*/
private function getPayloadForWebhook(WebhookEntity
$webhook, Hookable
$event): array
{ $source =
[ 'url' =>
$this->shopUrl,
'eventId' => Uuid::
randomHex(),
];
if ($webhook->
getApp() !== null
) { $shopIdProvider =
$this->
getShopIdProvider();
$source['appVersion'
] =
$webhook->
getApp()->
getVersion();
$source['shopId'
] =
$shopIdProvider->
getShopId();
} if ($event instanceof AppFlowActionEvent
) { $source['action'
] =
$event->
getName();
$payload =
$event->
getWebhookPayload();
$payload['source'
] =
$source;
return $payload;
}