Verify a webhook signature
verify_webhook_signatureValidates a Perly Pay webhook's HMAC-SHA256 signature and age locally to debug handlers that reject genuine events.
Instructions
Checks a Perly Pay webhook on this machine: the HMAC-SHA256 in its Perly-Signature header against the raw body and the endpoint's signing secret, and that it is under five minutes old. Nothing is sent anywhere. Use it to debug a webhook handler that rejects real events.
Pass the body exactly as received (the raw text, before JSON parsing). secret defaults to PERLY_PAY_WEBHOOK_SECRET.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| secret | No | The endpoint's signing secret, `whsec_…`. Default: PERLY_PAY_WEBHOOK_SECRET. | |
| payload | Yes | The request body, exactly as received. | |
| signature | Yes | The Perly-Signature header: `t=…,v1=…`. | |
| tolerance_seconds | No | How old a signature may be. Default 300. |