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:PCI Compliance
Never Store Card Numbers
Never Store Card Numbers
Never log, store, or display full card numbers. Use Cheqpay’s tokenization to keep card data secure.
Use HTTPS Everywhere
Use HTTPS Everywhere
Always use HTTPS for payment pages and API requests. Never accept card data over HTTP.
Implement CSP Headers
Implement CSP Headers
Use Content Security Policy headers to prevent XSS attacks on payment pages.
Rotate API Keys
Rotate API Keys
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 useexternalId 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:Security
Security
- ✅ API keys stored in environment variables
- ✅ HTTPS used on all payment pages
- ✅ No card data logged or stored
- ✅ API key rotation schedule
Payment Processing
Payment Processing
- ✅ Card payments working
- ✅ 3D Secure authentication implemented
- ✅ Device information included
- ✅ Billing address collected
- ✅ Payment methods saved for returning customers
Error Handling
Error Handling
- ✅ Customer-friendly error messages
- ✅ Retry logic for temporary failures
- ✅ Declined payment handling
- ✅ Client-side validation
- ✅ Error logging and monitoring
Customer Experience
Customer Experience
- ✅ Clear payment instructions
- ✅ Order status updates
- ✅ Email confirmations
- ✅ Refund policy communicated
- ✅ Support contact information
Operations
Operations
- ✅ 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