The verdict in three sentences
Never trust an unsigned webhook: anyone can call your URL and fake a successful payment. Defense rests on three pillars: HMAC signature verification, idempotency (process a notification only once) and replay protection. A flaw here can cost you repeated unpaid deliveries, far more than the cost of doing the integration right.
The three security pillars
Every webhook must pass these checks before crediting an order. An IP allowlist adds a layer, but never replaces the signature.
| Check | Role | Consequence if missing |
|---|---|---|
| HMAC signature | Authenticate sender | Fake payments accepted |
| Idempotency | Avoid double processing | Double crediting |
| Anti-replay (timestamp) | Block replayed sends | Payment replay |
| IP allowlist | Filter sources | Noise / attacks |
| Fast 2xx response | Confirm receipt | Retry loops |
| Logging | Audit, debug | Indefensible dispute |
Figures, latency and best practices
A well-built webhook responds fast and processes asynchronously. The operator retries if you don't return a 2xx, hence the importance of idempotency so you don't credit twice.
| Parameter | 2026 target | Note |
|---|---|---|
| Webhooks verified | 100 % | non-negotiable |
| Response latency | < 500 ms | else retries |
| Anti-replay window | 5 min | timestamp |
| Secret key rotation | every 6-12 months | security |
| Sandbox tests before prod | mandatory | Wave/OM/Stripe |
| Operator retry count | 3-5 | per PSP |
In practice: receive the raw payload, recompute the HMAC with your secret key, compare in constant time, verify the timestamp, then look up the transaction ID in your database; if it already exists, respond 200 without reprocessing.
Need a professional website?
Kolonell builds websites that attract clients, optimized for the Sénégalese market. Free quote in 2 minutes.
Mini case study
Modou, developer of a store in Thies, had an endpoint that credited any POST request. A burst of 7 fake notifications in one night triggered 7 unpaid order preparations, about 210,000 FCFA of committed goods. After adding HMAC verification, idempotency by transaction ID and an IP allowlist, zero false credits in 3 months, and operator retries are cleanly absorbed thanks to the idempotent 200 response.
FAQ
Why verify a webhook signature? Because the URL is public: without an HMAC signature, anyone can fake a valid payment. Verification guarantees the notification really comes from Wave, Orange Money or Stripe.
What is idempotency concretely? It means processing the same notification only once, even if the operator sends it multiple times. You store the transaction ID and ignore duplicates to avoid double-crediting.
How do I block webhook replay? By checking a timestamp within a short window (5 minutes) and rejecting any payload too old, even if its signature is valid.
Should I test in sandbox before production? Yes, absolutely. Wave, Orange Money and Stripe provide test environments; validate signature, idempotency and retries before opening real payments.
Is an IP allowlist enough? No. It filters noise but IPs can change or be spoofed; the HMAC signature remains the primary protection.
Let's talk about your project. We secure your payment webhooks with HMAC signature, idempotency and anti-replay, tested in sandbox before production. WhatsApp +221 77 596 93 33.
Mohamed Bah
Fondateur, Kolonell
Passionate about digital and entrepreneurship in Africa, Mohamed has been helping Sénégalese businesses with their digital transformation since 2020. Founder of Kolonell, he believes every SME deserves a professional and accessible online présence.


