WooCommerce Payment Gateway Setup: Stripe and PayPal Complete Guide
Getting paid is job one
You have your WooCommerce store live, your products listed, but customers can't pay. This is the worst moment. When I set up WooCommerce for a friend in 2025, it took me 3 days just to get payments working—Stripe kept throwing "Invalid API key" (wrong webhook URL), and PayPal's Sandbox/Production toggle caused every test order to get stuck in "pending".
This article is about one thing: the complete process of connecting Stripe and PayPal to WooCommerce, including the real mistakes I made.
---
Why Stripe + PayPal
For cross-border eCommerce, Stripe and PayPal are the most common combination:
Stripe works well when:
- You need 135+ currencies, global coverage
- Credit/debit cards, Apple Pay, Google Pay all supported
- Cleanest API documentation, easiest integration
- 2-day settlement, fast cash flow
PayPal works well when:
- Your audience is in Southeast Asia or Europe (PayPal balance users)
- Strong buyer protection reduces first-purchase hesitation
- High trust for new customers ("PayPal feels safer")
Recommended setup: Stripe as primary (card payments) + PayPal as secondary (PayPal users). Enable both.
---
Before you start
Make sure you have:
1. WordPress + WooCommerce installed (WooCommerce 8.0+; I tested with WooCommerce 10.7.0)
2. Stripe account (stripe.com, no monthly fee, 2.9%+0.3USD per transaction)
3. PayPal Business account (paypal.com, business verification required)
4. SSL certificate configured (payments require HTTPS; Let's Encrypt is free)
---
Step 1: Install the official payment plugins
WooCommerce has official gateway plugins—no need for third-party ones:
# via WP-CLI (recommended)
wp plugin install woocommerce-gateway-stripe --activate
wp plugin install paypal-for-woocommerce --activate
Or via admin: WooCommerce → Settings → Payments → Stripe/PayPal → Install
My mistake:
> ⚠️ Don't install multiple Stripe plugins simultaneously (like a third-party "Stripe for WooCommerce"). It conflicts with the official plugin and causes "Unexpected error" during checkout. Keep only woocommerce-gateway-stripe.
---
Step 2: Configure Stripe
Get your Stripe API keys
1. Log in to stripe.com/dashboard
2. Developers → API keys
3. Copy your test mode keys (pk_test_ prefix and sk_test_ prefix)
# Create webhook endpoint in Stripe Dashboard
# Format: https://yourdomain.com/?wc-api=wc_stripe
Configure in WooCommerce
WooCommerce → Settings → Payments → Stripe:
| Setting | Recommended | Why |
|---|---|---|
| Enable/Disable | ✅ Enabled | Turn on Stripe |
| Payment methods | Cards + Apple Pay + Google Pay | Enable what you need |
| Mode | Test mode (test first) | Switch to live before launch |
| Stripe Live API Key | sk_live_xxx | Fill after going live |
| Stripe Live Publishable Key | pk_live_xxx | Fill after going live |
| Webhook signature key | whsec_xxx | Required for payment verification |
My mistakes:
> ⚠️ **Webhook URL configuration:** Stripe Dashboard → Developers → Webhooks → Add endpoint. URL: https://yourdomain.com/?wc-api=wc_stripe. Events to select: payment_intent.succeeded, charge.refunded, invoice.payment_failed. I didn't select the events the first time, so payment succeeded but order stayed "pending".
> ⚠️ Forgetting to disable test mode: Always switch off "test mode" in WooCommerce Stripe settings before going live, and replace pk_test/sk_test with pk_live/sk_live. I forgot once—customers paid but all orders showed "on hold"—the money never arrived.
---
Step 3: Configure PayPal
Enable PayPal Sandbox for testing first
1. developer.paypal.com → Login → Dashboard
2. Create Sandbox accounts (simulated buyers)
3. WooCommerce → Settings → Payments → PayPal → Enable
4. Check "Enable PayPal Sandbox"
# PayPal API credentials location
# developer.paypal.com → Dashboard → My Apps & Credentials
# Select "Sandbox" mode → Create App
Fill in WooCommerce settings
| Setting | Recommended |
|---|---|
| PayPal Email | your-business@email.com |
| Enable PayPal Sandbox | ✅ Test first |
| Payment Experience | Express (or Standard) |
| Invoice Prefix | SHOP- (optional) |
| Debug Mode | ✅ Enabled (during testing) |
My mistakes:
> ⚠️ **PayPal sandbox account confusion:** The sandbox accounts you create in developer.paypal.com are for API calls, but you need to log into sandbox.paypal.com to simulate buyer payments. These are two separate systems. Their usernames may differ—don't assume they're the same.
> ⚠️ IPN error: If you see "Instruction type not recognized" error, it's usually because the email in WooCommerce doesn't match the PayPal Business account email. Make sure WooCommerce → PayPal Email matches your PayPal Business account exactly, or reconnect the PayPal account.
---
Step 4: Test the full payment flow
After configuration, don't go live immediately—walk through the complete test:
Test Stripe
# Use Stripe test card numbers
# Success: 4242 4242 4242 4242 | Any future date | Any 3-digit CVC
# Decline: 4000 0000 0000 0002
# 3DS challenge: 4000 0025 0000 3155
1. Checkout → select "Credit Card"
2. Enter test card number
3. After completion, check if WooCommerce order status changed to "Completed"
Test PayPal
1. Checkout → select "PayPal"
2. Click "Pay with PayPal"
3. Redirect to sandbox.paypal.com, login with Sandbox account
4. Confirm payment
5. Return to site, check order status
Verify Webhook triggers
In Stripe Dashboard → Developers → Webhooks → click your endpoint → "Recent events list". Confirm payment_intent.succeeded was triggered. If webhook doesn't fire, order status won't auto-update.
---
Step 5: Switch to Production
After all tests pass:
1. Stripe:
- WooCommerce → Stripe settings → Disable "Test mode"
- Fill in Live API keys (sk_live/pk_live)
- Webhook automatically switches to production
2. PayPal:
- WooCommerce → PayPal settings → Uncheck "Enable PayPal Sandbox"
- Confirm receiving email is correct
3. Run a small real transaction:
Test with a 1-unit product and confirm funds appear in your Stripe/PayPal account.
---
4 Common Mistakes Summary
| Mistake | Cause | Fix |
|---|---|---|
| Stripe "Invalid API key" | Wrong key OR webhook signature missing | Verify sk_test/sk_live correspondence; webhook signature is required |
| Payment succeeded but order pending | Webhook not triggered / events not selected | Check Stripe webhook events list, add payment_intent.succeeded |
| PayPal error "N/A" | WooCommerce email ≠ PayPal Business account email | Ensure emails match, or reconnect PayPal account |
| Forgot to disable test mode before launch | Didn't check mode toggle before going live | Habit: check WooCommerce → Stripe/PayPal settings every time before launch |
---
Who this is for
Good fit:
- Cross-border eCommerce sellers who already have WordPress/WooCommerce set up
- Technical entrepreneurs who want to handle payment setup themselves
- SEO-focused site builders who need a complete eCommerce funnel
Not for:
- Haven't installed WooCommerce yet → See WordPress Lnmp Installation Guide first
- Domestic China sales (need WeChat Pay/Alipay) → Needs separate coverage
- Completely new to WordPress → Learn the basics first
---
Verified Information
- WooCommerce version: 10.7.0 (released 2026-04-14, verified via GitHub)
- Stripe: 135+ currencies supported (verified at stripe.com), 2-day settlement
- PayPal Business registration: paypal.com/biz (business verification required)
- SSL: Let's Encrypt free certificate (covered in Lnmp installation article)
---
👉 Want to automate order notifications, inventory checks, and other repetitive tasks for your WooCommerce store? MiniMax API can help: Get started
🔗 Related Tech Articles
Deep dive into related technical topics: