1. Documentation /
  2. WooCommerce Payments Start Up Guide /
  3. Testing WooCommerce Payments /
  4. WooCommerce Payments Dev Mode

WooCommerce Payments Dev Mode

If you want to test WooCommerce Payments on a site that will never need to process real payments, you can use Dev Mode.

With Dev Mode, it’s possible to create a test account that requires no personal information. This account can then be used to process test transactions. It will only operate in Test Mode and cannot be used to process live transactions.

NOTE: WooCommerce Payments must be connected to WordPress.com, even in Dev Mode. This means it’s not possible to run WooCommerce Payments locally unless you expose your site test to the Internet with ngrok or a similar tool.

Enable Dev Mode ↑ Back to top

To enable Dev Mode, you can either:

  • Ensure your site’s environment type is set to either development or staging using the WP_ENVIRONMENT_TYPE constant.
  • Add the following constant to your site’s wp-config.php file:
define( 'WCPAY_DEV_MODE', true );

Note that Dev Mode must be enabled before starting the signup process in order to properly create a test account!

Create a test account ↑ Back to top

Complete the WooCommerce Payments test account creation process by following these steps:

  1. In your site’s dashboard, click the Payments menu item.
  2. Click the Finish Setup button.
  3. Connect to your WordPress.com account by entering your credentials.
  4. After connect to WordPress.com, the setup process will continue on connect.stripe.com.
    • You can verify that Dev Mode is enabled by looking for the “Test Mode” box.
Test Mode box, indicating that WooCommerce Payments is in Dev Mode.
  1. For the phone number, enter all zeros.
  2. Stripe will ask you to verify the phone number. Click the Use Test Code button.
  3. Enter anything for country and type of business.
  4. Enter any name and birthdate that’s in the past.
  5. Enter any valid email address.
  6. Enter any valid physical address.
  7. Enter all zeros for your tax ID, e.g. a Social Security Number.
  8. Enter any industry.
  9. For your bank details, click the Use Test Account button.
  10. At the end, click Submit to create the test account.
  11. Back on your site, you can verify that you’re in Dev Mode again under Payments → Settings.
Verifying that Dev Mode is enabled after setting up a test account.

Change Account ↑ Back to top

It is not possible for the WooCommerce Payments account connected to a store to be changed without assistance from WooCommerce support.

If you have set up a store in Dev Mode that needs to use a live account, please contact support to request that the existing Dev Mode account be disconnected or deleted.

WordPress Environment Type ↑ Back to top

WooCommerce Payments uses the wp_get_environment_type() function to monitor the site’s environment. If a site’s environment is set to either development or staging, then Dev Mode will be automatically enabled.

Environment Type Changes ↑ Back to top

If you copy a production site to a staging or development environment, and the site has never been in Dev Mode before, you will need to complete the account set up process again using the test details shown above. This will create a new test account for use while in Dev Mode on that site.

Your transaction data from the production environment will not be available while in Dev Mode on the staging or development environments. It will remain available on the production environment of course.

Disable Dev Mode ↑ Back to top

If you need to access transaction data from the production site on the staging or development site, the wcpay_dev_mode filter can be used to disable Dev Mode. Simply add the following snippet to your wp-config.php file:

add_filter( 'wcpay_dev_mode', '__return_false' );

Reset status ↑ Back to top

When Dev Mode is disabled, you will need to go through the account setup again, this time using real information for the account.

If an account was connected before Dev Mode was enabled, the store will revert to that setup.

WooCommerce

The most customizable eCommerce platform for building your online business.

  • 30-day money back guarantee
  • Support teams across the world
  • Safe and secure online payment