verify_webhook_signature
Validate HMAC-SHA256 webhook signatures from Stripe or Razorpay to confirm payload authenticity and prevent tampering before processing.
Instructions
Validates the cryptographic HMAC-SHA256 signature and tamper-resistance of an incoming webhook HTTP request payload against a shared webhook signing secret. Returns a JSON boolean indicating whether the signature matches the payload digest.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| secret | Yes | The private shared webhook signing secret configured in your provider developer dashboard. | |
| provider | Yes | The originating payment provider determining the signature algorithm ("stripe" parses timestamped t=,v1= signatures; "razorpay" computes standard hex HMAC-SHA256 digests). | |
| signature | Yes | The cryptographic signature string extracted from the HTTP request headers ("x-razorpay-signature" for Razorpay, "stripe-signature" for Stripe). | |
| rawPayload | Yes | The exact unparsed UTF-8 raw string body of the incoming HTTP request before any JSON parsing or middleware transformations. |