Skip to main content
Stay informed about payment events in real-time with Payvesselโ€™s reliable webhook system. Webhooks allow Payvessel to notify your application immediately when important events occur, such as successful payments, failed transactions, or account updates.

โšก Real-time Updates

Receive instant notifications when events occur

๐Ÿ”’ Secure Delivery

Cryptographically signed payloads for verification

Payment Notification Security

Critical security measures to protect your webhook endpoint from unauthorized access and ensure data integrity.

๐Ÿ” Security Implementation Requirements

1

Verify Payvessel Hash Signature

Validate HMAC SHA-512 signature to ensure data integrity
2

Verify Payvessel IP Address

Check that requests originate from trusted Payvessel servers
3

Prevent Duplicate Transactions

Implement transaction history checks to avoid duplicate processing

Webhook Security Implementation

๐Ÿ›ก๏ธ Hash Signature Verification

When receiving data from a webhook, itโ€™s crucial to ensure the data hasnโ€™t been tampered with during transmission:
Extract the Payvessel signature from the requestโ€™s metadata. This will be available in the HTTP_PAYVESSEL_HTTP_SIGNATURE header.
Use your secret key (PVSECRET-) as the key for an HMAC with the SHA-512 algorithm. The payload of the webhook request is used as the message input for this HMAC function.
Compare the generated hash with the Payvessel signature received in the requestโ€™s metadata. If they match, the data hasnโ€™t been tampered with.

๐ŸŒ IP Address Verification

Validate that incoming webhook requests originate from trusted Payvessel servers: Trusted IP Addresses:
  • 3.255.23.38
  • 162.246.254.36
If the IP address doesnโ€™t match the trusted list, reject the request as it may be unauthorized.

๐Ÿ”„ Duplicate Transaction Prevention

Webhooks can sometimes be delivered multiple times due to network issues or retries:
  • Transaction History Check: Query your payment transaction database to check if a transaction with the same reference already exists
  • Duplicate Handling: If a matching transaction is found, ignore the duplicate request
  • Idempotency: Ensure your webhook processing is idempotent

Implementation Examples

๐Ÿ Python Django Webhook Handler

Complete Django implementation with security verification:

๐Ÿ˜ PHP Webhook Handler

Secure PHP implementation for webhook processing:

๐ŸŸจ Node.js Express Webhook Handler

Complete Node.js implementation with security verification:

๐Ÿ’Ž Ruby on Rails Webhook Handler

Rails implementation with security verification:

โ˜• Java Spring Boot Webhook Handler

Spring Boot implementation with security verification:

Webhook Payload Structure

๐Ÿ“‹ Standard Webhook Format

Payvessel webhook payloads contain transaction and order information:

Testing Your Webhook Implementation

๐Ÿงช Local Development Setup

Test webhooks locally using ngrok or similar tools:

๏ฟฝ Webhook Testing Checklist

1

Signature Verification

โœ… Verify HMAC SHA-512 signature matches โœ… Use correct secret key (PVSECRET-) โœ… Handle raw payload for hash calculation
2

IP Address Validation

โœ… Check against trusted IP list โœ… Handle different IP header formats โœ… Account for proxy configurations
3

Duplicate Prevention

โœ… Check transaction reference uniqueness โœ… Handle duplicate webhook deliveries โœ… Implement idempotent processing
4

Error Handling

โœ… Return appropriate HTTP status codes โœ… Log webhook events for debugging โœ… Handle malformed payloads gracefully

Webhook Best Practices

โœ… Implementation Guidelines

๏ฟฝ Performance

  • Respond within 30 seconds
  • Process asynchronously when possible
  • Return 200 status immediately
  • Use queues for heavy processing

๐Ÿ”’ Security

  • Always verify signatures
  • Validate IP addresses
  • Use HTTPS endpoints only
  • Log security events

๐Ÿ”„ Reliability Measures

Payvessel Retry Policy:
  • Immediate retry for 5xx errors
  • Exponential backoff for subsequent attempts
  • Up to 3 days of retry attempts
  • Manual replay available in dashboard
Store webhook data:
  • Log all incoming webhooks
  • Store raw payload for debugging
  • Track processing status
  • Maintain audit trails

Troubleshooting Common Issues

Common Causes:
  • Using wrong secret key
  • Modifying payload before verification
  • Incorrect HMAC algorithm (should be SHA-512)
  • Character encoding issues
Solutions:
  • Verify secret key format (starts with PVSECRET-)
  • Use raw payload for hash calculation
  • Ensure UTF-8 encoding
  • Check header name formatting
Common Causes:
  • Proxy or load balancer configuration
  • Different IP header formats
  • Firewall or NAT translation
Solutions:
  • Check X-Forwarded-For header
  • Handle multiple IP formats
  • Update trusted IP list if needed
  • Test with different IP detection methods
Common Causes:
  • Network timeouts causing retries
  • Multiple webhook endpoints
  • Race conditions in processing
Solutions:
  • Check transaction reference before processing
  • Use database transactions for atomicity
  • Implement proper locking mechanisms
  • Return success for already processed transactions
Security Critical: Always implement all three security measures (signature verification, IP validation, and duplicate prevention) to ensure the integrity and security of your webhook endpoint.
Ready to implement webhooks?

โš™๏ธ Configure Webhooks

Set up webhook endpoints in your dashboard

๐Ÿงช Test Integration

Learn how to test your webhook implementation