DaletGuard supports civilians affected by armed conflict through Families Beyond War. All sides, no political affiliation. About our humanitarian work

Payment Webhook Verification Basics

Payment webhook verification is the check that each event message truly came from the provider that claims to send it. A provider sends a webhook to report a capture, a refund or a new dispute on one of your payments. Without the check, a forged message could quietly change a record that nobody on your team ever meant to change. With it, provider event signatures prove the source, so a record moves only when real events from that provider arrive. This article covers the signature check, the rule for repeats and the tests each provider needs before live traffic starts.

Illustration of key, receipt, card for payment webhook verification
Key takeaway

Check each provider event's signature before it changes a record. An invalid signature is rejected, and a repeated event is recognised. Test the rejection path in a sandbox for every provider.

Why is an unchecked payment event such a risk for you?

Without payment webhook verification, an endpoint that accepts any message is an open door. In fact, anyone who knows the address can claim that a refund was completed. As a result, a system that trusts the claim may mark a paid order as refunded. Then the record and the provider disagree, and nobody notices for weeks.

Honest providers cause a new kind of problem for payment webhook verification. For instance, messages arrive late, arrive twice or arrive out of order. Therefore, a system that treats each message as the first can put an old status over a new one. In short, payment webhook verification must cover both forged and messy traffic.

What does a forged refund event look like to you?

Indeed, it looks just like a real one, with the right fields and a likely amount. Only provider event verification tells the two apart. You must verify provider webhooks every time. For that reason, the webhook signature check must run before any other step.

How does a webhook signature check work on each event?

Each provider signs its messages with its own scheme, so you verify provider webhooks one by one. For example, some use a shared secret and a keyed hash of the body. Others use a public key and a signature sent in a header. However, the principle stays the same for all provider event signatures.

The receiver works out the value it expects from the raw body and its own secret. Then it takes the message only when the two values match, which is the core of a webhook signature check. This is how secure payment webhooks are built, and payment webhook verification follows the same logic everywhere. DaletPay works across 146 registered provider adapters, and each adapter declares its own scheme.

Why must the check use the raw body as it came?

Notably, a body that is read and built again may shift in its spacing or field order. In that case, provider event signatures would fail even for a real message. So DaletPay keeps the raw body until the webhook signature check is finished. Next, a bad signature marks the delivery as failed, returns a 400 response and changes no record.

Inbound events change records only after signature verification
An event with an invalid signature is rejected and changes no record.

The diagram shows both branches of payment webhook verification. First, a valid event is recorded and processed. In contrast, an invalid event stops at the check. The webhook event verification page describes how DaletPay applies this path.

How do you handle duplicate webhook events and late ones?

Typically, providers send a delivery again when they get no quick answer. Each retry carries the same event identifier as the first message, which helps payment webhook verification. Thus, a receiver that knows the identifier can report the event as replayed and skip the second change. This rule keeps duplicate webhook events from changing a record twice.

The rule also works with the keys that the platform sends with its own calls. Together, they make payment webhook verification safe in both directions. Still, duplicate webhook events are only part of the story, because late events need their own rule.

What should be done when an old event comes late?

Specifically, compare the event with the record's current state before you apply it. If the record already shows a later event, keep the older one on file. However, do not let it overwrite the newer state. Sandbox event testing should include one late event for this reason.

Which tests should each provider pass before it goes live?

Each provider needs its own tests. Its provider event signatures and timing are not the same as the rest. Run these checks before the provider sends live events. In practice, sandbox event testing takes about an hour per provider.

  • A valid event: trigger a test event and confirm that the matching record updates.
  • A bad signature: send the same body with a wrong signature, and confirm that nothing changes.
  • A repeated event: send the same event twice, and confirm the second is reported as replayed.
  • A late event: send an older event after a newer one, and confirm the newer state holds.

Afterwards, keep the results on the provider's capability card, next to the webhook endpoint setup notes. The provider capability checklist article shows how to record them. Also, repeat the sandbox event testing after any change to payment webhook verification.

What should you watch in the webhook delivery status later?

Read the webhook delivery status each day for the first week, as part of payment webhook verification. Look for failed deliveries, repeat tries and the same error text again and again. A run of failures often means a new secret or scheme, and secure payment webhooks need a fast fix. So fix the cause before events pile up and payment webhook verification falls behind.

Keep a short note for each webhook endpoint setup change. Also, record the date, the provider, the reason and the person who made the change. The note helps the team explain a gap later, and it keeps secure payment webhooks easy to audit. Moreover, it shows the check that each change got.

DaletPay payments overview screen
For example, the payments overview screen of DaletPay.

Who on the team should own the endpoint and alert?

Name one owner for the webhook endpoint setup, so you verify provider webhooks the same way each time. That owner reads the webhook delivery status, approves each change and gets the alert for repeated failures. Also, a short label with the provider and the environment shows which feed failed.

How do you recover from a bad delivery without guessing?

A bad delivery needs a clear path back, just as provider event verification needs a test plan. First, read the error text in the webhook delivery status. Second, check whether the event is real, using the provider's own dashboard. Third, ask the provider to resend a real event after the cause is fixed.

Above all, do not change the record by hand to match the expected outcome. Instead, write each recovery into the endpoint note, with the cause, the fix, the person and the date. A fix with no note is hard to explain when the same fault comes back. Practise these steps once a quarter, so the team keeps its webhook signature check sharp.

What are the next steps for your team from this point?

Start by testing the rejection path of payment webhook verification. Otherwise, a weak webhook signature check can pass unnoticed, since most teams test only the happy path. Once rejection works, test duplicate webhook events and late ones, then review your webhook endpoint setup. In the end, payment webhook verification and sandbox event testing turn provider traffic into records you can trust.

Next, read the payment operations guide to see how verified events feed reconciliation. Finally, the idempotency basics article covers the outbound side of the same story.

A diagram of 3 connected steps, each with a small drawing: Duplicate webhook events, Webhook delivery.

Questions and answers on this topic from the product team

How are provider event signatures checked against the raw body?

The receiver recomputes the expected value from the raw body and the secret or public key it holds, and accepts the message only when the values match. Schemes differ by provider, since some use a keyed hash with a shared secret and others a public key signature in a header. DaletPay keeps the raw body until the check ends, because a rebuilt body can fail a genuine signature.

How does DaletPay treat duplicate webhook events?

A provider retry carries the same event identifier as the first delivery, so DaletPay reports it as replayed and skips the second change. Late events need a separate rule. Compare the event with the record's current state, and keep an older event on file without letting it overwrite a newer status.

What does a failed webhook delivery status tell the team?

A delivery with an invalid signature is marked failed, gets a 400 response and changes no record. In the first week after go-live, read the delivery view daily. A cluster of failures with the same error text often points to a changed secret or scheme, so fix the cause and ask the provider to resend the event.

Which sandbox event testing steps come before live traffic?

Run four checks per provider, starting with a valid test event that updates the matching record. Next, send the same body with a wrong signature and confirm nothing changes. Then send one event twice and expect a replayed report, and finally confirm that an older event never overwrites a newer state.

What should we record for each webhook endpoint setup change?

Write a short note with the date, the provider, the reason and the person who made the change. Give the endpoint a label that names the provider and environment, so a reader sees which feed a failure belongs to. Name one owner who approves changes and receives the alert for repeated failures.

See how DaletPay fits the providers your team uses today

Book a short meeting for a walkthrough with your own providers in mind, or join an in-person class to learn the method first.