Unified webhook dispatcher for all Setu notification events.
Supported event categories
UPI Setu
payment.initiated/pending/success/failedmandate.initiated/live/rejected/paused/revoked/updatedmandate_operation.create/update/revoke/execute/notify.*refund.pending/successfuldispute_created/open/closed/in_review/won/lost
Account Aggregator
CONSENT_STATUS_UPDATESESSION_STATUS_UPDATE
BBPS
- Auto-detected from payload shape (
partnerDetails+eventskeys)
Plug usage (when plug dep is present)
# In your router
post "/webhooks/setu", SetuClient.Webhook.Handler, callbacks: MyApp.SetuCallbacksDirect dispatch
body = read_request_body(conn)
SetuClient.Webhook.Handler.dispatch_raw(body, MyApp.SetuCallbacks)
Summary
Functions
Returns true when the consent status in the event is "ACTIVE".
Returns the consent ID from an AA consent notification.
Returns the consent status from an AA consent notification data field.
Dispatches a decoded webhook event map to the appropriate callback.
Parses raw JSON and dispatches. Returns {:error, :decode} on bad JSON.
Returns the event type string from a decoded webhook event map.
Returns true when the event is a successful payment.
Returns true when the session status in the event is "COMPLETED".
Returns the data session ID from an AA session notification.
Returns the session status from an AA session notification data field.
Types
Functions
Returns true when the consent status in the event is "ACTIVE".
Returns the consent ID from an AA consent notification.
Returns the consent status from an AA consent notification data field.
Dispatches a decoded webhook event map to the appropriate callback.
{:ok, event} = Jason.decode(raw_body)
SetuClient.Webhook.Handler.dispatch(event, MyApp.SetuCallbacks)
Parses raw JSON and dispatches. Returns {:error, :decode} on bad JSON.
Returns the event type string from a decoded webhook event map.
Returns true when the event is a successful payment.
Returns true when the session status in the event is "COMPLETED".
Returns the data session ID from an AA session notification.
Returns the session status from an AA session notification data field.