Skip to main content
Verify webhook signatures to ensure incoming Payment Acceptance events are authentic. Payment Acceptance uses the same X-Hook0-Signature verification mechanism as all CDP webhooks.
Always verify webhook signatures before processing events. This protects your application from forged webhooks and potential security threats.

How it works

When you create a webhook subscription, the response includes a secret. Each incoming webhook request includes an X-Hook0-Signature header containing:
  • t field - the timestamp
  • h field - list of headers included in the signature
  • v1 field - the HMAC-SHA256 signature

Implementation

For complete verification code in TypeScript, Python, Go, Ruby, PHP, and Java, see the CDP Webhook Verification guide. The mechanism is identical for all CDP products, including Payment Acceptance. The short version:
  1. Extract t, h, and v1 from the X-Hook0-Signature header
  2. Build the signed payload: {timestamp}.{headerNames}.{headerValues}.{body}
  3. Compute HMAC-SHA256 using your subscription secret
  4. Compare the computed signature with v1 using constant-time comparison
  5. Reject events older than 5 minutes (replay protection)

Quick example

Full verification code

Complete verification implementations in 6 languages

Webhook Subscriptions

Create and manage webhook subscriptions

Example payloads

Event payload shapes for testing