AirtelMoney.WebhookPlug (airtel_money v0.1.0)

Copy Markdown View Source

Plug for handling Airtel Money webhooks in Phoenix applications.

Usage

Add to your router:

pipeline :webhooks do

plug AirtelMoney.WebhookPlug

end

scope "/webhooks" do

pipe_through :webhooks
post "/airtel", WebhookController, :handle

end

The plug will:

  1. Verify the webhook signature
  2. Parse the JSON payload
  3. Assign the parsed data to conn.assigns[:airtel_webhook]
  4. Call the next plug if verification succeeds
  5. Return 401 if verification fails