Plug for handling Airtel Money webhooks in Phoenix applications.
Usage
Add to your router:
pipeline :webhooks do
plug AirtelMoney.WebhookPlugend
scope "/webhooks" do
pipe_through :webhooks
post "/airtel", WebhookController, :handleend
The plug will:
- Verify the webhook signature (if webhook_secret is configured)
- Parse the JSON payload
- Assign the parsed data to
conn.assigns[:airtel_webhook] - Call the next plug if verification succeeds or if authentication is disabled
- Return 401 if verification fails (when authentication is enabled)
Options
:require_auth- Set tofalseto skip signature verification (default:true)