Skip to main content

Custom Gateways

Subscribd’s gateway system is driver-based. If none of the built-in gateways fit your needs, implement the Gateway contract and register your driver in config.

Implement the Gateway contract

The DefaultGatewayCapabilities concern provides no-op implementations for optional capability methods. Use it as a starting point:

Register your gateway

Add it to config/subscribd.php:
You can access your gateway config inside the driver class via config('subscribd.gateways.my_gateway').

Set as the default

Or use it per-subscription:

Handling webhooks

Register a webhook controller and route it through Subscribd’s webhook pipeline by creating an event handler for your gateway’s events:
Implement handleWebhook(Request $request): Response on your gateway class to process incoming webhook payloads and dispatch the appropriate Subscribd events (SubscriptionCreated, SubscriptionUpdated, etc.).

Next steps