1. Documentation /
  2. Stripe WooCommerce Extension /
  3. Customer experience with the Stripe WooCommerce Extension /
  4. Testing the Stripe WooCommerce Extension

Testing the Stripe WooCommerce Extension

The Stripe WooCommerce Extension is very versatile. A part of this versatility is a dedicated way to perform test transactions on your WooCommerce site via the built-in test mode feature. This allows you to make purchases using Stripe test cards.

Performing test transactions via test mode is a great way to simulate the customer experience or troubleshoot issues without using real funds.

In this guide, you will learn how to configure the Stripe WooCommerce Extension to enable test mode and accept test payments.

Configuring Stripe WooCommerce Extension for testing

↑ Back to top

When you initially connect your Stripe account to the Stripe WooCommerce Extension, it allows you to accept live payments from customers using real card credentials. It does this by connecting to your Stripe account using what are called API Keys, and these API keys are supported by configuring webhooks.

If you’d like to configure your Stripe WooCommerce Extension to be able to accept test payments, then you’ll have to add Test API Keys and configure webhooks for your account while it is in test mode.

Adding your test API keys

↑ Back to top

To accept test payments via the Stripe WooCommerce Extension, you’ll need to enter test account API credentials. To add these API keys:

  1. Navigate to your Stripe account’s dashboard at dashboard.stripe.com.
  2. Toggle the Test mode option at the top-right of the page.
    • This will allow for test information to be displayed in your Stripe dashboard, including test transactions, test API keys, etc.
    • You can verify that Test mode has been toggled on correctly if it turns orange, the slider turns orange, and there is an orange TEST DATA banner on your dashboard.
  1. Select the Developers menu item on the top-right of the page.
  2. Select the API keys tab to locate your account’s public and secret keys.
  3. Copy your Publishable key to your clipboard by clicking it with your mouse.
  4. Navigate back to the Stripe WooCommerce Extension settings in your site’s administrator dashboard at WooCommerce > Settings > Payments > Stripe > Settings.
  5. Select Edit account keys.
    • This will bring up the Edit live account keys & webhooks popup.
  6. Select the Test tab at the top to access the test credentials section.
  7. Paste the Publishable key in the TEST PUBLISHABLE KEY section of the Edit live account keys & webhooks popup:
  1. Navigate back to your Stripe dashboard and reveal your Secret key by selecting the Reveal live key button.
  2. Confirm that you would like to reveal the secret key by selecting the red Reveal button.
  3. Click on the secret key to copy it to your clipboard.
  4. Navigate back to the Stripe WooCommerce Extension settings in your site’s administrator dashboard.
  5. Paste the Secret key in the LIVE SECRET KEY section of the Edit live account keys & webhooks popup.
  6. Select Save live keys to save the Edit live account keys & webhooks settings.

Adding your test webhook secret

↑ Back to top

To truly simulate payments via the Stripe WooCommerce Extension’s test mode, you’ll need to configure webhooks and add a webhook secret. To add a webhook secret for test purchases:

  1. Navigate to WooCommerce > Settings > Payments > Stripe > Settings from your admin dashboard.
  2. Select Edit account keys.
    • This will bring up the Edit live account keys & webhooks popup.
  3. Select the Test tab at the top to access the Stripe test credentials section.
  4. Highlight the webhook endpoint — which is usually your site’s URL followed by ?wc-api=wc_stripe — and copy it to your clipboard.
  5. Navigate to your Stripe dashboard at dashboard.stripe.com in a new tab or window.
  6. Toggle the Test mode option at the top-right of the page.
  7. Select the Developers item on the top-right of the page.
  8. On the next page, select the Webhooks tab.
  9. From here, select the Add an endpoint button.
  10. Paste the webhook endpoint URL you copied previously in the Endpoint URL field.
  11. Add an optional description.
  12. Select which webhook endpoints to listen to.
  13. Select the Add endpoint button once you’ve added all of the events you’d like your site to listen to.
    • After selecting the Add endpoint button, you will be redirected to the webhook details automatically.
  14. Select the Reveal option under Signing secret.
    • The Reveal option will turn into a webhook signing secret key, which will be a string of characters that begins with whsec_.
  15. Highlight the webhook signing secret and copy it to your clipboard.
  16. Navigate to WooCommerce > Settings > Payments > Stripe > Settings from your admin dashboard.
  17. Select the Test tab at the top to access the Stripe test credentials section.
  18. Once there, select Edit account keys to bring up the Edit live account keys & webhooks popup.
  19. Paste the webhook signing secret into the WEBHOOK SECRET section of the Edit live account keys & webhooks popup.
  20. Select Save live keys to save the Edit live account keys & webhooks settings.

Enabling test mode

↑ Back to top

Once your test API keys and test webhook secret are configured, you can enable test mode.

To enable test mode:

  1. Navigate to WooCommerce > Settings > Payments > Stripe > Settings from your admin dashboard.
  2. Check the Enable test mode option in the General section.
  1. Scroll to the bottom of the page and select the Save Changes button to save your settings.

Using test mode

↑ Back to top

Once test mode is enabled, you can make a test purchase by:

  1. Navigating to your store’s shop page.
  2. Adding a product to your cart.
  3. Proceeding to the checkout page.
  4. Adding a Stripe test card as a payment method.
    • There are numerous cards for testing different scenarios, such as successful payments, declines, etc.
  5. Selecting the Place order button.

If you used a card that resulted in a successful payment, you’ll be redirected to your site’s thank you page, which confirms:

  • The order was placed successfully.
  • The order number.
  • The information provided when placing the order.
  • The products purchased.
  • The payment method used.
  • The total amount charged.

Using test mode with express checkouts

↑ Back to top

You can also test Stripe WooCommerce Extension’s express checkouts while in test mode.

  • If you are using Google Pay, you will want to take one of the Stripe test cards and add it to your Google account.
  • If you are using Apple Pay, you will be unable to add a test card to your Apple ID.
    • The Stripe WooCommerce Extension will use the card credentials saved to your Apple ID without charging your saved payment method.