DocumentaçãoDeveloper guideCriar um complemento
Drivers de pagamento, envio e SMS
Um complemento de provedor registra uma classe de driver. A tela compartilhada Integrações mostra então as configurações dele, o botão de teste e o endereço de webhook.
1 min de leitura
- Estenda
App\Support\Integrations\IntegrationDriver. Implementekey(),kind(),label(),credentialFields()etestConnection()(app/Support/Integrations/IntegrationDriver.php:24-45). - Registre-o a partir de um hook de inicialização:
IntegrationRegistry::register(KEY, Driver::class)(app/Support/Integrations/IntegrationRegistry.php:77). O Stripe faz isso emapp/Addons/Stripe/StripeAddon.php:15, com'hooks' => ['boot' => [...]]no manifesto, como o Paystack emapp/Addons/Paystack/addon.php:19. - Para receber notificações, sobrescreva
receivesWebhooks(),verifyWebhook(),webhookEvent()ehandleWebhook()(app/Support/Integrations/IntegrationDriver.php:121-171). Veja Webhooks.