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 while in test mode is a great way to simulate the customer experience or troubleshoot issues without having to charge any real payment methods.

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 a test webhook 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

↑ Back to top

To configure a testing webhook for use in test mode:

  1. Navigate to WooCommerce > Settings > Payments > Stripe > Settings.
  2. Ensure that the Test Mode setting is enabled.
    • If it’s not enabled, turn it on by checking the Test Mode box, then scroll to the bottom of the page and click Save Changes.
  3. Click the Edit account keys button.
  4. Select the Test tab at the top of the popup to see the test credentials section.
  5. Click the Configure webhooks button.
  6. Your test mode webhook will be added to the Stripe dashboard automatically!

Enabling test mode

↑ Back to top

Once your test API keys and test webhook 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.