Stripe Test Mode Setup
This tutorial walks you through setting up Stripe in test mode to safely develop and test your subscription system.
Estimated time: 15-20 minutes
Prerequisites
- PaywallWP Pro installed and activated
- SSL certificate (HTTPS) on your site
Step 1: Create Stripe Account & Get Test API Keys
1.1 Create or Log In to Stripe
- Go to https://dashboard.stripe.com/register
- Create a new account or log in to existing account
- Complete account setup if prompted (email verification, etc.)
1.2 Enable Test Mode
- Look at the top-right corner of the dashboard
- Find the "Test mode" toggle switch
- Click to enable it — the toggle should show orange/yellow color
- You'll see "TEST DATA" badge appear in the dashboard header
When test mode is enabled, you'll see an orange banner and "Test mode" label throughout the dashboard. All data you create here is separate from live data.
1.3 Get Your Test API Keys
-
Click Developers in the left sidebar
-
Click API keys
Direct URL: https://dashboard.stripe.com/test/apikeys
-
You'll see two keys:
Key Type Format Visibility Publishable key pk_test_...Visible by default Secret key sk_test_...Hidden — click "Reveal" -
Copy both keys and save them somewhere secure — you'll need them in Step 4
Click the "Reveal test key" button next to the Secret key. You may need to re-authenticate with your password or 2FA.
- Publishable key (
pk_test_) — Safe to use in frontend code - Secret key (
sk_test_) — Never expose publicly, server-side only
Step 2: Create a Subscription Product & Price
Stripe organizes subscriptions as Products (what you're selling) with Prices (how much and how often).
2.1 Navigate to Product Catalog
-
In Stripe Dashboard, click More + in the left sidebar
-
Click Product catalog
Direct URL: https://dashboard.stripe.com/test/products
2.2 Create a New Product
-
Click + Add product button (top right)
-
Fill in Product information:
Field Example Required Name Premium Membership Yes Description Full access to all premium articles and exclusive content Optional Image Upload a product image (recommended 512x512px) Optional
Use clear, customer-facing names. This name appears on invoices and the customer portal.
2.3 Add Recurring Price
-
Scroll down to Price information section
-
Select Recurring (not One time)
-
Fill in pricing details:
Field Example Notes Amount 9.99 Price per billing period Currency USD Match your PaywallWP currency Billing period Monthly Monthly, Yearly, Weekly, etc. -
Click Add product to save
2.4 Add Yearly Price (Recommended)
Offering annual pricing typically increases revenue. To add:
- Go back to your product in Product catalog
- Click on the product name to open it
- In the Pricing section, click + Add another price
- Configure the yearly price:
Field Example Amount 99.00 Currency USD Billing period Yearly - Click Add price
A common practice is ~17% discount for annual (e.g., $9.99/mo = $120/yr, but offer $99/yr). This encourages longer commitments.
2.5 Copy Your Price IDs
Each price has a unique identifier used by PaywallWP:
- On the product page, find your prices listed under Pricing
- Each price shows an ID starting with
price_ - Click on a price row to expand details
- Copy the Price ID (e.g.,
price_1ABC123xyz...)
| Price | Example ID |
|---|---|
| Monthly | price_1AbC2dEfGhIjK3lM |
| Yearly | price_1NoPqRsTuVwXyZ4a |
PaywallWP syncs with Stripe automatically — you don't need to manually enter Price IDs. However, knowing where to find them helps with troubleshooting.
Step 3: Set Up Webhooks
Webhooks are essential. They notify PaywallWP when payments succeed, subscriptions change, renewals process, etc. Without webhooks, subscriptions won't activate.
3.1 Navigate to Webhooks
-
In Stripe Dashboard, click Developers in the left sidebar
-
Click Webhooks
Direct URL: https://dashboard.stripe.com/test/webhooks
3.2 Create Webhook Endpoint
-
Click + Add endpoint button
-
Enter your Endpoint URL:
https://yoursite.com/wp-json/paywallwp/v1/stripe-webhookReplace DomainReplace
yoursite.comwith your actual domain. The URL must use HTTPS. -
Click + Select events
-
In the event selector, search and check each of these events:
Event Purpose Critical? checkout.session.completedNew subscription payment completed Yes customer.subscription.createdNew subscription created Yes customer.subscription.updatedPlan changes, renewals, status changes Yes customer.subscription.deletedSubscription canceled/ended Yes invoice.paidRecurring payment successful Yes invoice.payment_failedRecurring payment failed Yes charge.refundedRefund issued Recommended -
Click Add events to confirm selection
-
Click Add endpoint to create the webhook
3.3 Copy Webhook Signing Secret
The signing secret verifies webhook requests actually come from Stripe:
-
Click on your newly created webhook endpoint to open it
-
Find the Signing secret section (right side)
-
Click Reveal to show the secret
-
Copy the secret — it starts with
whsec_Example:
whsec_1234567890abcdefghijklmnop
| Key | Starts With | Purpose |
|---|---|---|
| API Secret Key | sk_test_ | Authenticate API requests |
| Webhook Signing Secret | whsec_ | Verify webhook authenticity |
These are different values. Make sure you copy the webhook signing secret (whsec_), not your API secret key (sk_test_).
Step 4: Configure PaywallWP Settings
4.1 Open Payment Settings
- In WordPress admin, go to PaywallWP → Settings
- Click the Payments tab
4.2 Configure Stripe
-
Find the Stripe section
-
Click the Test Mode button to select it (button should appear active/highlighted)
-
Enter your credentials:
Field Value From Test Publishable Key pk_test_...Step 1.3 Test Secret Key sk_test_...Step 1.3 Test Webhook Secret whsec_...Step 3.3 -
Click Save Settings
After saving, if keys are invalid, you'll see an error message. Double-check for:
- Extra spaces before/after the key
- Missing characters (keys are long!)
- Mixing up test and live keys
Step 5: Create Plan in PaywallWP
5.1 Create New Plan
- Go to PaywallWP → Plans
- Click Add New Plan
5.2 Configure Plan Details
| Field | Example | Notes |
|---|---|---|
| Plan Name | Premium | Customer-facing name |
| Slug | premium | URL-friendly identifier |
| Monthly Price | 9.99 | Must match your Stripe price |
| Yearly Price | 99.00 | Optional, must match Stripe |
| Access Level | 5 | 1-10, higher = more access |
| Trial Days | 0 | Free trial period (optional) |
Your PaywallWP plan prices must match your Stripe product prices exactly. If Stripe has $9.99/month, PaywallWP must also have $9.99/month.
5.3 Add Features List
Enter the features/benefits shown on your pricing page. One feature per line:
Unlimited access to all premium articles
Weekly exclusive newsletter
Ad-free reading experience
Members-only community forum
Early access to new content
Direct support via email
5.4 Publish
- In the Publish meta box, set Status to Published
- Click Publish button
Step 6: Test the Integration
6.1 Protect a Post
- Edit any post or page
- Find the Content Protection meta box in the sidebar (or below editor)
- Set Access Level to a value ≤ your plan's access level
- Example: If plan has Access Level 5, set post to 5 or lower
- Click Update to save
6.2 Test Payment Flow
-
Open an incognito/private browser window (important — avoids cached login)
-
Visit your protected post
-
You should see the paywall blocking content
-
Click the Subscribe or Choose Plan button
-
Select your plan and proceed to checkout
-
Use Stripe's test card:
Field Value Card number 4242 4242 4242 4242Expiry date Any future date (e.g., 12/34)CVC Any 3 digits (e.g., 123)ZIP/Postal code Any 5 digits (e.g., 12345)Cardholder name Any name -
Complete the checkout
6.3 Additional Test Cards
| Card Number | Scenario |
|---|---|
4242 4242 4242 4242 | Successful payment |
4000 0000 0000 0002 | Card declined |
4000 0000 0000 9995 | Insufficient funds |
4000 0025 0000 3155 | Requires 3D Secure authentication |
4000 0000 0000 3220 | 3D Secure 2 required |
All test cards use:
- Any future expiry date
- Any 3-digit CVC
- Any billing details
See Stripe's Testing Documentation for the complete list of test card numbers.
6.4 Verify Success
Check PaywallWP Members:
- Go to PaywallWP → Members
- You should see the new subscriber
- Status should show "Active"
- Plan should show your plan name
Check Stripe Dashboard:
- Go to https://dashboard.stripe.com/test/payments
- You should see the test payment
- Go to Customers to see the new customer
Check Webhook Delivery:
- Go to https://dashboard.stripe.com/test/webhooks
- Click your webhook endpoint
- Check Recent deliveries section
- All deliveries should show ✓ green checkmark (HTTP 200)
Test Content Access:
- In the same incognito window (now logged in as subscriber)
- Visit the protected post
- Full content should now be visible without paywall
Troubleshooting
"Invalid API Key" Error
Symptoms: Error when saving settings or during checkout
Solutions:
- Verify keys are copied completely (no extra spaces)
- Confirm you're using test keys (start with
pk_test_andsk_test_) - Make sure Test Mode is selected in PaywallWP (not Live Mode)
- Try revealing and re-copying the keys from Stripe
Webhook Shows Errors (HTTP 4xx/5xx)
Symptoms: Webhook deliveries show red X marks in Stripe
Solutions:
- Check webhook URL is exactly correct (no typos)
- Verify your site uses HTTPS (not HTTP)
- Check if a security plugin is blocking REST API requests
- Temporarily disable firewall/security plugins to test
- Check the specific error message in Stripe's webhook logs
- Verify WordPress permalinks aren't set to "Plain"
Payment Succeeds but Subscription Not Active
Symptoms: Card charged, but member not showing in PaywallWP
This is always a webhook issue. Check:
- Webhook signing secret is correct (
whsec_..., notsk_test_...) - Webhook deliveries are succeeding (green checkmarks)
- All required events are selected
- Enable
WP_DEBUGand check/wp-content/debug.logfor errors
Test Card Declined
Symptoms: Test card number not working
Solutions:
- Use
4242 4242 4242 4242for successful payments - Ensure Test Mode is enabled in both Stripe Dashboard AND PaywallWP
- Check you're on sandbox.stripe.com (test mode), not live dashboard
3D Secure Popup Not Appearing
Symptoms: Payment hangs when using 3DS test cards
Solutions:
- Ensure your site uses HTTPS
- Check browser isn't blocking popups
- Disable ad blockers temporarily
- Try a different browser
Local Development (Optional)
For testing webhooks on localhost, use Stripe CLI:
# Install Stripe CLI (macOS)
brew install stripe/stripe-cli/stripe
# Or download from https://stripe.com/docs/stripe-cli
# Login to your Stripe account
stripe login
# Forward webhooks to your local site
stripe listen --forward-to localhost/wp-json/paywallwp/v1/stripe-webhook
The CLI outputs a webhook signing secret for local testing. Use this temporary secret in PaywallWP settings while developing locally.
Next Steps
You've completed Stripe test mode setup!
- Ready for real payments? → Stripe Live Mode Setup
- Want to offer PayPal too? → PayPal Sandbox Setup
- Learn about content protection → Content Protection Guide