Stripe is the gold standard for online payments, powering millions of businesses worldwide. Integrating Stripe with WHMCS gives your customers a seamless checkout experience with support for cards, digital wallets, and recurring subscriptions. This guide covers everything from basic setup to advanced optimizations.
Why Choose Stripe?
- Support for 135+ currencies and all major cards
- Apple Pay, Google Pay, and Link support
- PCI DSS Level 1 certified - no sensitive card handling
- Advanced fraud detection with Radar
- Instant payouts available in many countries
Prerequisites
Before you begin, ensure you have:
- WHMCS 8.0 or later installed
- Valid SSL certificate on your WHMCS installation
- Stripe account (sign up at stripe.com)
- Verified Stripe business identity
Step 1: Get Your Stripe API Keys
- Log in to your Stripe Dashboard
- Navigate to Developers → API Keys
- Copy your Publishable key (starts with pk_)
- Click "Reveal test key" to get your Secret key (starts with sk_)
Test Mode First
Always configure and test with test keys first. Test keys start with
pk_test_ and sk_test_. Switch to live keys
only after thorough testing.
Step 2: Configure Stripe in WHMCS
- In WHMCS Admin, go to Setup → Payments → Payment Gateways
- Click All Payment Gateways tab
- Find and click Stripe
- Enter your API credentials:
- Publishable Key
- Secret Key
- Configure additional options (covered below)
- Click Save Changes
Step 3: Configure Webhooks
Webhooks are essential for Stripe to notify WHMCS about payment events like successful charges, failed payments, and subscription renewals.
Create Webhook Endpoint
- In Stripe Dashboard, go to Developers → Webhooks
- Click Add endpoint
- Enter your webhook URL:
https://yourdomain.com/modules/gateways/callback/stripe.php - Select events to listen for:
payment_intent.succeededpayment_intent.payment_failedinvoice.payment_succeededinvoice.payment_failedcustomer.subscription.deletedcharge.refunded
- Click Add endpoint
- Copy the Signing secret
Add Webhook Secret to WHMCS
In WHMCS Stripe gateway settings, paste the webhook signing secret in the Webhook Endpoint Secret field.
Enabling Payment Methods
Stripe supports multiple payment methods. Configure these in your Stripe Dashboard:
Digital Wallets
- Apple Pay: Verify your domain in Stripe Dashboard
- Google Pay: Enabled by default with card payments
- Link: Stripe's one-click checkout
Alternative Payment Methods
Enable these in Stripe Dashboard → Settings → Payment methods:
- SEPA Direct Debit (Europe)
- iDEAL (Netherlands)
- Bancontact (Belgium)
- BACS Direct Debit (UK)
- ACH Direct Debit (US)
3D Secure (SCA) Configuration
3D Secure is required for European transactions under SCA regulations. WHMCS's Stripe integration handles this automatically, but ensure:
- Your Stripe integration uses Payment Intents (default in WHMCS 8+)
- Webhooks are properly configured
- Your checkout page supports the 3DS authentication popup
Subscription/Token Billing Setup
For recurring billing, configure token billing in WHMCS:
- Go to Setup → Payments → Payment Gateways → Stripe
- Set Credit Card Storage to "Yes"
- Choose token billing behavior:
- Always: Tokenize all transactions
- Optional: Let customer choose
- Never: Don't store cards (not recommended)
Best Practice
Enable "Always" for token billing. This allows automatic recurring payments and significantly reduces payment failures and churn.
Optimizing Conversion Rates
Maximize successful payments with these optimizations:
Enable Stripe Radar
Stripe's machine learning fraud detection. Configure in Stripe Dashboard:
- Enable Radar for Fraud Teams if available
- Set up custom rules based on your risk tolerance
- Review blocked transactions regularly
Smart Retries
Configure retry logic in WHMCS:
- Go to Setup → Automation Settings
- Enable Retry on Payment Failure
- Set appropriate retry intervals (1, 3, 7 days)
Customer Portal Card Updates
Allow customers to update expired cards:
- Customers can update cards in Client Area → Billing
- Send expiry reminder emails before cards expire
- Use Stripe's automatic card updater (enabled by default)
Testing Your Integration
Use Stripe's test card numbers to verify your setup:
Test Card Numbers
| Scenario | Card Number |
|---|---|
| Successful payment | 4242 4242 4242 4242 |
| Requires 3D Secure | 4000 0027 6000 3184 |
| Declined card | 4000 0000 0000 0002 |
| Insufficient funds | 4000 0000 0000 9995 |
Use any future expiry date and any 3-digit CVC.
Going Live
Once testing is complete:
- Complete Stripe identity verification if not done
- Replace test API keys with live keys
- Create a new webhook endpoint with your live endpoint secret
- Test with a small real transaction
- Monitor your first few days of transactions closely
Troubleshooting Common Issues
Payments Not Processing
- Verify API keys are correct (test vs. live)
- Check WHMCS module log for errors
- Ensure SSL certificate is valid
Webhooks Failing
- Verify webhook URL is accessible
- Check webhook signing secret matches
- Review webhook logs in Stripe Dashboard
3D Secure Issues
- Ensure WHMCS is updated to latest version
- Check for JavaScript errors on checkout page
- Test with 3DS-required test cards
Conclusion
Stripe integration with WHMCS provides a world-class payment experience for your customers. With proper configuration of webhooks, 3D Secure, and token billing, you'll minimize payment failures and maximize revenue. Regular monitoring of your Stripe Dashboard helps catch issues before they impact your business.
Need Help with Payment Integration?
I specialize in WHMCS payment gateway integrations including Stripe, PayPal, and custom solutions. Let me help you optimize your payment flow.
Get Payment Integration Help
About Shahid Malla
ExpertFull Stack Developer with 10+ years of experience in WHMCS development, WordPress, and server management. Trusted by 600+ clients worldwide for hosting automation and custom solutions.