This guide walks you through connecting Stripe so customers can pay with a card. You will work in both your WordPress admin and the Stripe Dashboard. If you have never used Stripe before, that is fine, the steps below assume only basic familiarity with WordPress.
Money from sales goes to your Stripe account. Avenia Digital Products does not take a cut of your payments.
Recommended order: set up test mode → test a purchase → only then add live credentials.
Before you start
You need:
- An active WordPress site with Avenia Digital Products installed
- An SSL certificate (your site URL should start with https://)
- A Stripe account (free to create at https://stripe.com)
Keep Simulate payments on in the plugin while you set things up. That way you can practice products, emails, and downloads without contacting Stripe. When you are ready to test Stripe itself, turn Simulate payments off and choose Test mode (sandbox).
If you run the plugin on more than one site (for example your store and a demo), register a separate webhook endpoint for each site’s webhook URL. You can reuse the same Stripe account and keys; each site still needs its own endpoint and signing secret pasted into that site’s settings.
Step 1: Open Stripe and use Test Mode
- Go to https://stripe.com and create an account, or log in if you already have one.
- Complete any business details Stripe asks for. You can start in test mode even before your business profile is fully approved, but live charges require a completed account.
- In the Stripe Dashboard, turn Test mode ON (often a switch in the top bar).
When Test mode is on, you are using test keys and fake cards. When it is off, you are in live mode. Stay in Test mode for Steps 2–6. Live comes later in Step 7.

Step 2: Copy your test secret key
Avenia Digital Products only needs Stripe’s secret keys (they start with sk_test_ or sk_live_). You do not need a publishable key. Checkout happens on Stripe’s hosted page, so the plugin talks to Stripe from your server using the secret key alone.
- In the Stripe Dashboard, open Developers → API keys.
- Confirm Test mode is still ON.
- Copy the Secret key (sk_test_…).
- In WordPress, go to Avenia Digital Products → Settings → Payment.
- Check Enable Stripe.
- Under Stripe Test credentials, paste the key into Secret key.
- Click Save Settings.
Do not paste a sk_live_ key into the Test field, or the other way around.



Step 3: Register the test webhook
A webhook is how Stripe tells your site that a payment finished, even if the customer closes the browser before returning to your thank-you page. Webhooks are especially important for subscriptions (renewals, cancellations, and failed payments).
- In WordPress, open Avenia Digital Products → System Status.
- Copy the Stripe Webhook URL. It looks like: https://yoursite.com/wp-json/avenia-digital-products/v1/stripe-webhook Use your real domain, not “yoursite.com”.
- In Stripe (Test mode still ON), go to Developers → Webhooks.
- Click Add destination.
- Paste the URL from System Status into the endpoint URL field.
- Choose which events to send. At minimum, select:
- checkout.session.completed
- customer.subscription.updated
- customer.subscription.deleted
- invoice.paid
- invoice.payment_failed
- Save the endpoint.
- Open the endpoint you just created and reveal the Signing secret (it starts with whsec_).
- Back in WordPress, Settings → Payment → Stripe Test credentials, paste that secret into Webhook signing secret.
- Save Settings.






If you register a webhook in Stripe, you must paste the matching signing secret. Without it, the plugin rejects Stripe events and cannot verify they really came from Stripe. Leave the signing secret empty only if you have not registered a webhook at all, and note that subscriptions will not update correctly without webhooks.
Step 4: Turn on test mode in the plugin
Settings → Payment has two separate controls:
Simulate payments
When checked, checkout finishes on your site without contacting Stripe. Use that while building products and emails.
Real payments use (shown when simulate is off)
Test mode (sandbox) uses your Test credentials (sk_test_…). No real money is charged.
Live mode uses your Live credentials (sk_live_…). Real money is charged.
For the rest of this test walkthrough:
- Uncheck Simulate payments.
- Set Real payments use to Test mode (sandbox).
- Confirm Enable Stripe is still checked.
- Save Settings.
You should still be on Test credentials only. Leave Live blank until Step 7.
Step 5: Use a Stripe test card
In test mode you do not use a real credit card. Stripe provides test card numbers.
On Stripe’s payment page, use:
- Card number: 4242 4242 4242 4242
- Expiry: any future date
- CVC: any 3 digits
- Postal / ZIP: any value Stripe accepts
More test cards (declines, authentication, and so on) are listed in Stripe’s docs:
https://docs.stripe.com/testing
Keep 4242… handy for the next step.
Step 6: Try a test payment and verify
Test both product types if you sell them. One-time and subscription checkouts are handled differently in Stripe Checkout.
Prepare
- Create a paid product if you do not have one yet (see Creating Products).
- Confirm Settings → Payment still has Simulate off and Test mode (sandbox) selected.
- Confirm the Test secret key and webhook signing secret are saved.
- Open System Status and confirm Stripe shows configured for test credentials.
One-time product
- Add the one-time product to the cart and go to checkout.
- Choose Stripe and complete purchase.
- On Stripe’s payment page, enter the test card from Step 5.
- Complete payment and wait to be returned to your site.
- You should land on the thank-you / order completed page (not an error URL).
Subscription product
- Add a subscription product to the cart (do not mix with one-time items in the same cart, see Important limitations below).
- Choose Stripe and complete purchase.
- Pay with the test card and return to your site’s thank-you page.
- The order should show Completed and Access Active (or equivalent), with a Stripe payment / subscription reference stored on the order.
Verify in WordPress
- Open Avenia Digital Products → Orders.
- Confirm the order status is Completed.
- Confirm Payment method is Stripe and a transaction ID is stored.
- Open the order details and confirm line items, totals, and (if used) license keys look correct.
- If the product delivers a file, confirm the customer can download it from the thank-you page or My Account.
- Confirm order / download / license emails were sent (or check your mail logs if email is not configured yet).
- For subscriptions, open Avenia Digital Products → Subscriptions (or the customer’s My Account → Subscriptions) and confirm the subscription is active and linked to Stripe.
Optional Stripe-side checks (test mode)
- In the Stripe Dashboard (Test mode ON), open Payments and confirm the test charge appears.
- For subscriptions, open Billing → Subscriptions and confirm the test subscription is active.
- Open Developers → Webhooks → your endpoint and confirm recent deliveries succeeded (not failing with signature errors).
If the order stays pending, or you return to a payment error URL, check:
- Simulate is off and Real payments use is Test mode (sandbox)
- Test secret key (sk_test_…) and webhook signing secret (whsec_…) are filled in
- Webhook URL on System Status matches the endpoint in Stripe
- Stripe Dashboard Test mode is ON while you copy test keys and create the test webhook
- You used a Stripe test card, not a real card, while in test mode
Step 7: Go Live (real payments)
Only after a test checkout works, set up live credentials the same way:
- In the Stripe Dashboard, turn Test mode OFF.
- Open Developers → API keys and copy the live Secret key (sk_live_…).
- Paste it into WordPress → Settings → Payment → Stripe Live credentials → Secret key.
- Still in live mode in Stripe, go to Developers → Webhooks and add an endpoint.
- Paste the same Stripe Webhook URL from System Status.
- Subscribe to the same events listed in Step 3.
- Copy the live Signing secret (whsec_…) into the Live Webhook signing secret field.
- Save Settings.
- Set Real payments use to Live mode (keep Simulate payments off).
- Save Settings again.
- Complete a small real purchase yourself and verify the order the same way as in Step 6.
Test and live each need their own secret key, webhook endpoint (created while Stripe is in that mode), and signing secret.
Important limitations
Stripe Checkout cannot process a cart that contains both a one-time product and a subscription product in a single payment. If a customer tries that, checkout will fail.
Ask customers to buy one-time and subscription items in separate checkouts. PayPal has the same mixed-cart restriction.
Multiple subscription products in one cart work with Stripe. PayPal checkout in this plugin supports only one subscription product per checkout. If both gateways are enabled, checkout still lists both.
Subscriptions with Stripe
If you sell subscription products, Stripe handles recurring charges. Your site listens for webhook events when a subscription renews, fails, or is cancelled. Keep the webhook endpoint active and the signing secret saved. If the webhook URL or signing secret is missing or wrong, initial checkout may still succeed when the customer returns to your site, but later renewals may not update access correctly.
Customers can cancel from My Account on your site, which cancels billing at Stripe. If you only revoke access in the WordPress admin, billing at Stripe continues until you cancel it there as well. See Subscriptions and Access Control.
Going live checklist
- Test purchase worked (Step 6)
- Stripe account is fully set up for live payments
- Live secret key (sk_live_…) saved
- Live webhook endpoint registered with the URL from System Status
- Live webhook signing secret (whsec_…) saved
- Simulate payments is turned OFF
- Real payments use is set to Live mode
- You completed a small real purchase yourself (one-time and/or subscription)
- Order, email, download, and (if applicable) license / subscription all worked