Example #1
0
 public function onWebhookReceived(WebhookEvent $event)
 {
     $webhook = $event->getWebhook();
     if (!is_null($webhook)) {
         $request = $event->getRequest();
         $webhook->execute($request, $event->getContext());
     }
 }
Example #2
0
 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);
         }
     }
 }