Why Webhooks Matter
Real-Time Updates
Get payment updates without polling every transaction.
Reliable Completion
Confirm final status (
success or failed) before fulfilling orders.Operational Safety
Handle retries with idempotent processing to avoid duplicate fulfillment.
Webhook Payload Fields
| Field | Description |
|---|---|
event | Event type (for example payment.completed, payment.failed) |
clientId | Your Payfonte client identifier |
data.status | Transaction status (success, failed, or pending) |
data.reference | Payfonte transaction reference |
data.externalReference | Merchant-provided reference (if supplied) |
data.amount | Transaction amount in minor units |
data.charge | Applied transaction charge |
data.provider | Provider slug/name used for processing |
data.channel | Payment channel (for example card, mobile-money) |
data.user | Customer metadata (name/email/phone when available) |
payment.completed
Signature Verification (Required)
Every webhook includes:- Header:
x-webhook-signature - Value:
sha512HMAC digest of raw request body, signed with yourclient-secret
client-secret from Settings -> API Keys/Webhooks.
Idempotent Processing Pattern
Check duplicates
Use
reference + status (or a delivery identifier if available) to detect already-processed events.Verify transaction when needed
For critical flows, verify payment status from your backend before final fulfillment.
Webhook URL Priority
Payfonte uses webhook URLs in this order:- Webhook URL passed in the checkout/direct-charge request (
webhook) - Webhook URL configured on the provider integration
- Webhook URL configured in dashboard settings
Common Issues
| Issue | Likely Cause | Fix |
|---|---|---|
| Duplicate webhook processing | No idempotency guard | Track processed reference + status and skip repeats |
| Signature mismatch | Wrong secret or payload mutation | Use correct client-secret and hash the exact received body |
| Missed updates | Endpoint timeout/non-200 responses | Return 200 quickly and move heavy work to async workers |
| Wrong environment events | Mixed sandbox/production setup | Use matching endpoint and credentials per environment |