Skip to content
E Webhook Package Documentation

Php Api

PHP API

This page documents the main classes used when working with RelayKit directly.

RelayKit

RelayKit::make()
    ->withSecret('secret')
    ->withStorage($storage)
    ->withDispatcher($dispatcher);

IncomingWebhook

Represents the incoming HTTP request.

$webhook->header('X-Payment-Signature');
$webhook->payload('customer.id');
$webhook->rawBody();

WebhookEvent

Represents a verified and normalised event.

$event->name();
$event->provider();
$event->data('customer_id');
$event->deliveryId();

WebhookHandler

Handlers must implement the WebhookHandler contract.

use RelayKit\Contracts\WebhookHandler;
use RelayKit\Events\WebhookEvent;

class ExampleHandler implements WebhookHandler
{
    public function handle(WebhookEvent $event): void
    {
        // Handle the event.
    }
}

© Webhook Package Documentation