MockingCrow: Test Payment Gateway for WooCommerce

Description

MockingCrow adds a test gateway to WooCommerce, so you can run the whole checkout without a real payment provider, an API key or a sandbox account.

After placing an order, the customer is taken to a hosted test payment page. The page shows the order summary, and the customer chooses the outcome:

  • Approve: the order is marked paid (Processing or Completed) and the customer sees the order received page.
  • Decline: the order is marked Failed and the customer sees WooCommerce’s “payment failed” page, with a Pay button to try again.
  • Cancel and return to store: the order is cancelled and the customer goes back to the cart.

Why I built this

I build WooCommerce stores and plugins, and every project hits the same wall: to test anything that happens after checkout, you need an order that has actually been paid.

The usual options all slow you down:

  • A real gateway’s sandbox needs an account, API keys and webhooks that can reach your machine. That is hard on localhost, and every developer on the team has to set it up.
  • Cash on delivery or bank transfer never marks an order as paid, so the order stays On hold and nothing that depends on payment runs.
  • Changing order statuses by hand in the admin skips the code paths a real payment goes through, so bugs in those paths stay hidden.

I wanted a gateway that behaves like a real hosted payment page: the customer leaves the checkout, decides what happens, and comes back. Then WooCommerce does exactly what it would do with a real payment. No account, no keys, no internet connection needed. MockingCrow is that gateway.

Why test with a mock gateway

The checkout is where a store makes its money, and it is also the part that is hardest to test. A mock gateway lets you test the whole order flow, from cart to “Thank you” page, as many times as you need, for free.

  • Real order lifecycle. Approving calls WooCommerce’s own payment_complete(), so stock is reduced, the order moves to Processing or Completed, the customer and admin emails are sent, and every hook that listens for a paid order runs, such as woocommerce_payment_complete and woocommerce_order_status_processing.
  • Failure paths too. Most bugs hide in the unhappy path. Decline an order to see the “payment failed” page, the failed-order email and the Pay again flow. Cancel to test what happens when a customer walks away.
  • Repeatable. Every test order goes through the same steps, so you can reproduce a bug, fix it and check the fix in a couple of minutes.
  • Safe. No card numbers, no real customer data and no money ever leave your site.
  • Works offline. Everything runs on your own server, so it works on localhost, inside Docker, on a plane, or on a staging site behind a password.

Who it is for

  • Store builders checking a new theme, checkout layout or Thank you page before launch.
  • Plugin developers testing code that runs when orders are paid, failed, cancelled or refunded, such as memberships, digital downloads, licence keys, CRM or ERP sync, and fulfilment integrations.
  • Email designers who need to trigger real WooCommerce order emails.
  • QA teams and automated tests (Playwright, Cypress and similar) that need a checkout which completes without a third-party iframe. The payment page uses plain HTML forms with stable labels, so it is easy to script.
  • Agencies and freelancers showing clients the complete buying journey on a demo or staging site.
  • Teachers and students learning how WooCommerce orders work.

Example workflows

Test a new theme before launch

  1. Activate MockingCrow on your staging site and turn on Admins only.
  2. Place an order and approve it. Check the Thank you page and the emails.
  3. Place another order and decline it. Check the failed page, then pay again from the link.
  4. Refund the paid order from the order screen and check the refund email.

Test a plugin that runs on paid orders

  1. Place an order with MockingCrow and approve it.
  2. Check that your plugin did its job, for example granted access, sent data to an API or created a licence.
  3. Place another order and decline it. Make sure your plugin did nothing.

Features

  • Works with the Checkout block and the classic [woocommerce_checkout] shortcode.
  • Compatible with High-Performance Order Storage (HPOS).
  • Uses WooCommerce’s own order functions, so orders behave exactly like real paid, failed or cancelled orders.
  • Each approved payment gets a unique transaction ID that starts with MOCK-, so test orders are easy to recognise.
  • Refunds from the order screen always succeed, and each one is logged as an order note.
  • An “Admins only” option hides the gateway from everyone except shop managers and administrators.
  • The payment page shows the store name, icon, items and totals, and works on phones.
  • The payment page is a template that you can override in your theme.
  • Protected against tampering: each payment page link needs the order’s secret key, and each choice is checked with a WordPress nonce.
  • Translation ready.
  • No external requests, no tracking, no ads and no upsells. No data leaves your site.

Warning: never use on a live store

Anyone who picks Approve gets their order without paying. MockingCrow is a development and testing tool only.

  • On a local site, use it freely.
  • On a staging or demo site that others can reach, turn on Admins only in WooCommerce > Settings > Payments > MockingCrow.
  • Before launch, deactivate and delete the plugin, then enable your real payment gateway.

Privacy

MockingCrow does not collect, store or send any personal data. It makes no external HTTP requests and sets no cookies. The only thing it saves is its own settings, which are removed when you delete the plugin.

Screenshots

Installation

  1. Make sure WooCommerce is installed and active.
  2. In WordPress, go to Plugins > Add New, search for “MockingCrow: Test Payment Gateway for WooCommerce”, then install and activate it. Or upload the mockingcrow-test-payment-gateway folder to /wp-content/plugins/ and activate it from the Plugins screen.
  3. Go to WooCommerce > Settings > Payments and make sure MockingCrow is enabled.
  4. Add something to the cart, check out, and choose MockingCrow (test).

FAQ

Is any real money charged?

No. The plugin never contacts a payment provider. It only changes the order status in WooCommerce.

Can customers on my live store use it to get free orders?

Yes, if it is enabled and visible to them. That is why it must never be used on a live store. On a public staging site, turn on Admins only.

How do I customise the payment page?

Copy wp-content/plugins/mockingcrow-test-payment-gateway/templates/payment-window.php to wp-content/themes/your-theme/mockingcrow/payment-window.php and edit the copy. Updates to the plugin will not overwrite it.

Does it support subscriptions or saved cards?

Not yet. It supports simple and variable product orders and refunds.

Does it work with the Checkout block?

Yes. It works with both the Checkout block and the classic checkout.

Will the plugin mark my test orders in some way?

Yes. Each approved payment gets a transaction ID that starts with MOCK-, and every step is logged as an order note, such as “customer sent to the payment window” or “customer approved the payment”.

Do order emails get sent?

Yes. MockingCrow uses WooCommerce’s normal order functions, so all the usual emails are sent: new order, processing, completed, failed and refunded. Use a mail catcher such as Mailpit if you do not want emails to leave your development site.

Can I use it in automated tests?

Yes. The payment page is a plain HTML form. Your test can select the “Approve” or “Decline” option, click the submit button, and wait for the order received page.

Why not just use Cash on delivery?

Cash on delivery and bank transfer leave the order On hold or Processing without ever marking it as paid. Code that runs on payment_complete, a failed payment, or a payment retry is never tested. MockingCrow goes through the same steps as a real gateway.

Does it work on localhost?

Yes. MockingCrow makes no external requests and needs no webhooks, so it works on any local setup.

What happens to my data when I delete the plugin?

The gateway settings are removed. Orders and their notes are kept.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“MockingCrow: Test Payment Gateway for WooCommerce” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

0.1.1

  • Order notes now say “customer approved the payment” and “customer declined the payment”, matching the Approve and Decline options on the payment page.
  • New plugin icon, banner and screenshots.

0.1.0

  • Initial release.
  • Hosted test payment page with order summary, Approve and Decline options, and a cancel link.
  • Checkout block and HPOS support.
  • “Admins only” setting.
  • Refunds that always succeed.