Schema for webhook event logging and idempotency.
Every webhook received from payment providers is logged here to:
- Ensure idempotency (same event_id is never processed twice)
- Track processing status and errors
- Enable debugging and auditing
- Support retry logic for failed events
Idempotency
Before processing a webhook, we check if an event with the same
provider + event_id combination exists. If it does, we skip
processing and return success to prevent retries from provider.
Retry Logic
Failed events can be retried:
- Provider sends retry (we check idempotency, process if not done)
- Manual retry via admin interface
- Background worker for events stuck in processing
Summary
Functions
Creates a changeset for a webhook event.
Changeset for marking an event as failed.
Returns true if the event has exceeded max retries.
Returns true if the event was successfully processed.
Changeset for marking an event as processed.
Returns true if the event has failed and can be retried.
Functions
Creates a changeset for a webhook event.
Changeset for marking an event as failed.
Returns true if the event has exceeded max retries.
Returns true if the event was successfully processed.
Changeset for marking an event as processed.
Returns true if the event has failed and can be retried.