Payment Gateways
Understanding payment gateway integration in OwnPay.
What is a Payment Gateway?
A payment gateway is a service that processes payments by:
- Accepting customer payment information
- Encrypting and transmitting to the payment processor
- Receiving authorization from the bank
- Returning result to OwnPay
- Settling funds to your account
Gateway Types
Processor Gateways
Direct integrations with payment processors:
- Stripe - Cards, wallets, local payments
- PayPal - Cards, PayPal account, wallets
- Square - Cards, Apple Pay, Square Cash
- 2Checkout - Cards, wallets, local payments
- Razorpay - Cards, UPI, wallets (India focus)
Local Payment Gateways
Regional payment methods:
- bKash - Mobile money (Bangladesh)
- Nagad - Mobile payment (Bangladesh)
- GCash - Mobile payment (Philippines)
- AliPay - China payment method
- WeChat Pay - China payment method
Bank Gateways
Direct bank integrations:
- Bank Transfer - ACH, SEPA, wire
- Direct Debit - Recurring bank payments
- Open Banking - PSD2, UKOA
Custom Gateways
Build your own:
- Custom processor integration
- Proprietary payment method
- Legacy system integration
- Unique requirements
Payment Methods
Each gateway supports different payment methods:
Card Payments
- Visa
- Mastercard
- American Express
- Discover
- Diners Club
- JCB
Digital Wallets
- Apple Pay
- Google Pay
- PayPal
- Amazon Pay
Bank Payments
- Bank Transfer
- Direct Debit
- ACH (US)
- SEPA (EU)
- iDEAL (Netherlands)
Mobile Money
- bKash
- Nagad
- GCash
- M-Pesa
- Vodafone M-Money
Regional Methods
- China: AliPay, WeChat Pay
- India: UPI, NEFT
- Brazil: Pix
- Mexico: OXXO
Gateway Configuration
Adding a Gateway
- Go to Gateways → Payment Gateways
- Click Add Gateway
- Select gateway type
- Enter credentials:
- API Key / Merchant ID
- Secret Key
- Account ID (if applicable)
- Choose payment methods to enable
- Set as primary (optional)
- Click Save
Gateway Credentials
Each gateway needs:
- API Key - Public identifier
- Secret Key - Private authentication
- Merchant ID - Account identifier
- Endpoint URL - Gateway address
⚠️ Security: Never share secret keys. Rotate them regularly.
Test vs Live Mode
- Test Mode - Sandbox, no real charges
- Live Mode - Real transactions
- Use test mode during development
- Switch to live when ready
Currency Support
Multi-Currency
Each gateway may support:
- USD, EUR, GBP - Common currencies
- 100+ currencies - Many gateways support
- Automatic conversion - Some gateways handle
- Real-time rates - Current exchange rates
Configuration
- Go to Gateways → Currencies
- Add currencies you accept
- Set exchange rates
- Update rates periodically
Settlement
How Settlement Works
- Customer pays → Funds captured
- OwnPay records → Transaction logged
- Gateway batches → Daily/weekly
- Gateway settles → Funds to bank account
- Appears in bank → 1-3 business days
Settlement Times
- Stripe - 1-2 days
- PayPal - 1 day
- Square - Next business day
- Razorpay - 1 day (premium) / 2-3 days (standard)
Settlement Fees
Most gateways charge:
- Percentage fee - 2-3.5% per transaction
- Fixed fee - $0.10-0.50 per transaction
- Monthly fee - $0-20 (enterprise)
- Setup fee - Usually waived
Webhooks and Notifications
Real-Time Updates
Gateways send webhooks when:
- Payment authorized
- Payment captured
- Refund processed
- Dispute filed
- Chargeback initiated
OwnPay Processing
OwnPay receives webhooks:
- Verifies signature authenticity
- Updates transaction status
- Triggers your webhooks
- Sends customer notification
Security Features
PCI Compliance
- Data encryption - HTTPS/TLS
- Tokenization - Card data never stored
- Fraud detection - Real-time monitoring
- 3D Secure - Additional authentication
Fraud Prevention
- AVS (Address Verification) - Address matching
- CVV (Card Verification) - CVV validation
- 3D Secure - Bank authentication
- ML Detection - Machine learning fraud detection
Gateway Switching
Adding Another Gateway
- Configure new gateway
- Set payment method preferences
- Test with test transactions
- Switch to live mode
- Monitor for issues
Switching Primary Gateway
- Configure backup gateway
- Migrate in phases:
- Start directing 10% of traffic
- Monitor success rates
- Increase percentage gradually
- Eventually move all traffic
Load Balancing
Distribute payments across gateways:
- Payment method-based routing
- Random distribution
- Sequential rotation
- Custom logic
Troubleshooting
Payment Declined
Cause: Gateway or bank declined Solution:
- Check error message from gateway
- Verify credentials are correct
- Ensure gateway is in live mode
- Check account balance/limits
- Try different payment method
Webhook Not Received
Cause: Network, configuration, or validation issue Solution:
- Check webhook URL is correct
- Verify webhook endpoint is accessible
- Check logs for incoming webhooks
- Verify signature validation logic
- Contact gateway support if still failing
Settlement Delayed
Cause: Holdback, review, or processing Solution:
- Check gateway dashboard
- Review account status
- Check for reserves/holdbacks
- Contact gateway support
Best Practices
Multiple Gateways
- ✅ Use 2+ gateways for redundancy
- ✅ Load balance for reliability
- ✅ Diversify payment methods
- ✅ Monitor success rates
Security
- ✅ Use test mode during development
- ✅ Never log sensitive data
- ✅ Verify webhook signatures
- ✅ Rotate API keys quarterly
Monitoring
- ✅ Track success rates
- ✅ Monitor settlement times
- ✅ Review fees and rates
- ✅ Alert on failures
Summary
Payment gateways in OwnPay:
- ✅ Support 100+ payment methods
- ✅ Enable worldwide payments
- ✅ Provide secure processing
- ✅ Support multiple gateways
Ready to configure your gateway? → Gateway Setup