📚 Related Reading

← Back to Home

WooCommerce Payment Gateway Setup: Stripe and PayPal Complete Guide

WooCommerceStripePayPaleCommercepayment gatewaycross-border

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:

PayPal works well when:

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:

SettingRecommendedWhy
Enable/Disable✅ EnabledTurn on Stripe
Payment methodsCards + Apple Pay + Google PayEnable what you need
ModeTest mode (test first)Switch to live before launch
Stripe Live API Keysk_live_xxxFill after going live
Stripe Live Publishable Keypk_live_xxxFill after going live
Webhook signature keywhsec_xxxRequired 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

SettingRecommended
PayPal Emailyour-business@email.com
Enable PayPal Sandbox✅ Test first
Payment ExperienceExpress (or Standard)
Invoice PrefixSHOP- (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

MistakeCauseFix
Stripe "Invalid API key"Wrong key OR webhook signature missingVerify sk_test/sk_live correspondence; webhook signature is required
Payment succeeded but order pendingWebhook not triggered / events not selectedCheck Stripe webhook events list, add payment_intent.succeeded
PayPal error "N/A"WooCommerce email ≠ PayPal Business account emailEnsure emails match, or reconnect PayPal account
Forgot to disable test mode before launchDidn't check mode toggle before going liveHabit: check WooCommerce → Stripe/PayPal settings every time before launch

---

Who this is for

Good fit:

Not for:

---

Verified Information

---

👉 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:

WooCommerce Payment Gateway Setup: Stripe and PayPal Complete Guide
技术标签: woocommerce, stripe
WooCommerce支付网关配置:Stripe与PayPal完整接入指南
技术标签: stripe, paypal
WooCommerce支付网关配置:Stripe与PayPal完整接入指南
技术标签: stripe, paypal
💻 Recommended Hardware
查看推荐 →