Signature verification
Elite Neo Bank signs every webhook request using HMAC SHA256 to ensure webhook authenticity and payload integrity. Webhook signature verification helps merchants:- Verify webhook authenticity
- Prevent unauthorized requests
- Detect payload tampering
- Protect webhook endpoints against replay attacks
Webhook Headers
Every webhook request contains:Signature Formula
Refer to: \ ➡️ Signature GenerationVerification Process
To verify a webhook request:- Read the raw webhook payload
- Extract
X-SIGNATUREheader - Extract
X-TIMESTAMPheader - Generate local HMAC SHA256 signature
- Compare generated signature with received signature
- Process webhook only if signatures match
Important Rules
- Use the raw request payload exactly as received
- Do not modify JSON formatting before verification
- Verify timestamps to prevent replay attacks
- Reject invalid signatures immediately
- Always use your server-side
secret_key
Example Webhook Payload
- Node.js
- PHP
- Python
- Java
Common Verification Failures
Invalid Signature
Possible reasons:- Incorrect secret key
- Modified payload
- Incorrect JSON formatting
- Wrong timestamp
- Incorrect signature generation logic
Expired Timestamp
Possible reasons:- Delayed webhook processing
- System time mismatch
- Replay attack prevention triggered
Security Recommendations
- Always verify webhook signatures
- Use HTTPS webhook endpoints only
- Reject invalid requests immediately
- Store webhook logs securely
- Verify timestamps before processing
- Never expose secret keys publicly
Replay Attack Protection
Elite Neo Bank includes timestamps in webhook requests to prevent replay attacks. Replay attacks occur when attackers resend previously valid webhook payloads maliciously. To prevent replay attacks:- Validate timestamps
- Reject old requests
- Store processed webhook event IDs
- Implement idempotent processing
Recommended Production Workflow
- Receive webhook request
- Read raw payload
- Extract headers
- Verify signature
- Validate timestamp
- Store webhook event
- Verify transaction using APIs
- Update internal systems
- Return HTTP 200 response
Best Practices
- Process webhooks asynchronously
- Avoid long-running webhook responses
- Return HTTP 200 quickly
- Verify payment/payout status using APIs
- Maintain webhook audit logs
