Skip to main content

Overview

Follow these guidelines to build a robust integration and provide the best experience for your customers.

Security

Protect Your API Keys

Never expose API keys in client-side code or version control:

Environment Variables

Store credentials securely:
Add .env to your .gitignore file. Never commit API keys to version control.

PCI Compliance

Never log, store, or display full card numbers. Use Cheqpay’s tokenization to keep card data secure.
Always use HTTPS for payment pages and API requests. Never accept card data over HTTP.
Use Content Security Policy headers to prevent XSS attacks on payment pages.
Regularly rotate API keys (every 90 days recommended). Update and test before deactivating old keys.

Optimize Success Rates

Include Device Information

Send device data with every payment to improve approval rates:

Save Payment Methods

Returning customers with saved cards have 3-5% higher approval rates:

Include Billing Address

Billing address verification improves approval rates:

Consistent Customer Data

Use the same customer information across all payments:

Idempotency

Always use externalId to prevent duplicate charges:

Safe Retries

With idempotency, you can safely retry failed requests:

Monitor Payment Status

Check payment status when needed using the GET endpoint. For production systems, consider implementing efficient status checking patterns to minimize unnecessary API calls.

Error Handling

Show User-Friendly Messages

Implement Retry Logic

Performance Optimization

Cache Customer Data

Process Refunds Asynchronously

Logging and Monitoring

Log Important Events

Monitor Key Metrics

Set Up Alerts

Integration Checklist

Before going live, ensure you have:
  • ✅ API keys stored in environment variables
  • ✅ HTTPS used on all payment pages
  • ✅ No card data logged or stored
  • ✅ API key rotation schedule
  • ✅ Card payments working
  • ✅ 3D Secure authentication implemented
  • ✅ Device information included
  • ✅ Billing address collected
  • ✅ Payment methods saved for returning customers
  • ✅ Customer-friendly error messages
  • ✅ Retry logic for temporary failures
  • ✅ Declined payment handling
  • ✅ Client-side validation
  • ✅ Error logging and monitoring
  • ✅ Clear payment instructions
  • ✅ Order status updates
  • ✅ Email confirmations
  • ✅ Refund policy communicated
  • ✅ Support contact information
  • ✅ Comprehensive logging
  • ✅ Metrics and monitoring
  • ✅ Alert thresholds set
  • ✅ Refund workflow tested
  • ✅ Support team trained

Code Organization

Separation of Concerns

Configuration Management

Testing

Test Coverage

Next Steps

Testing Guide

Test your integration thoroughly

Error Handling

Handle errors gracefully

Going Live

Production readiness checklist

API Reference

Complete API documentation