DocsDeveloper guideBuild an add-on
Payment, shipping and SMS drivers
A provider add-on registers a driver class. The shared Integrations screen then shows its settings, test button and webhook address.
1 min read
- Extend
App\Support\Integrations\IntegrationDriver. Implementkey(),kind(),label(),credentialFields()andtestConnection()(app/Support/Integrations/IntegrationDriver.php:24-45). - Register it from a boot hook:
IntegrationRegistry::register(KEY, Driver::class)(app/Support/Integrations/IntegrationRegistry.php:77). Stripe does this inapp/Addons/Stripe/StripeAddon.php:15, with'hooks' => ['boot' => [...]]in its manifest, as Paystack does atapp/Addons/Paystack/addon.php:19. - To receive notifications, override
receivesWebhooks(),verifyWebhook(),webhookEvent()andhandleWebhook()(app/Support/Integrations/IntegrationDriver.php:121-171). See Webhooks.