public function onWebhookReceived(WebhookEvent $event) { $webhook = $event->getWebhook(); if (!is_null($webhook)) { $request = $event->getRequest(); $webhook->execute($request, $event->getContext()); } }
private function dispatchWebhookEvents(WebhookEvent $webhookEvent) { foreach ($this->webhooks as $webhook) { $event = $webhook->getEvent(); if (!is_null($event)) { $webhookEvent->setWebhook($webhook); $this->dispatcher->dispatch($event, $webhookEvent); } } }