Skip to content

webmonk/sandbox-payment-gateway

Repository files navigation

Sandbox Payment Gateway for WooCommerce

WordPress WooCommerce License Version

A WooCommerce plugin that provides fake Credit Card and ACH/eCheck payment gateways for testing checkout flows — no real payments, no coupon workarounds, no third-party sandbox accounts needed.

Features

  • Sandbox Credit Card Gateway — accepts any valid card number, validates with Luhn algorithm, expiry date, and CVV checks
  • Sandbox ACH/eCheck Gateway — accepts check name, routing number (9 digits), and account number (4-17 digits)
  • Failure Simulation — trigger failed payments on demand for testing error handling
  • Refund Support — process test refunds from the WooCommerce admin order page
  • Admin Configurable — customize gateway titles and descriptions from WooCommerce settings
  • Secure — nonce verification, input sanitization, and output escaping throughout

Test Data

Credit Card

Scenario Card Number Expiry CVV
Success Any valid card number (e.g. 4111111111111111) Any future date Any 3-4 digits
Failure 4929000000022 Any future date Any 3-4 digits

ACH / eCheck

Scenario Routing Number Account Number
Success (on-hold) Any valid 9-digit number (e.g. 121000248) Any 4-17 digit number
Failure 000000000 Any 4-17 digit number

Installation

From WordPress.org

  1. Go to Plugins > Add New in your WordPress admin
  2. Search for "Sandbox Payment Gateway"
  3. Click Install Now, then Activate

Manual Installation

  1. Download the latest release and upload the sandbox-payment-gateway folder to /wp-content/plugins/
  2. Activate through the Plugins menu in WordPress
  3. Go to WooCommerce > Settings > Payments to enable the sandbox gateways

Frequently Asked Questions

Can I test with real credit card numbers?

Yes. Since payments are simulated, no charges will ever be made regardless of the card number used.

What happens with eCheck payments?

Successful eCheck payments are placed in on-hold status to simulate the real-world verification period.

Development

Development happens at GitHub. Pull requests welcome.

WordPress.org Assets

Plugin page assets are in .wordpress-org/ and deployed automatically via GitHub Actions when changes are pushed to main.

Changelog

1.1.0

  • Fix: ACH payment form now renders correctly on checkout
  • Fix: ACH eCheck icon loads correctly
  • Fix: Visa card icon now shown in credit card gateway
  • Fix: Class name typo (WpsgAch → WspgAch)
  • Security: WooCommerce dependency check with admin notice
  • Security: Nonce verification on payment processing
  • Enhancement: ACH routing and account number validation
  • Enhancement: ACH failure simulation (routing number 000000000)
  • Enhancement: Refund support for both gateways
  • Enhancement: Proper text domain (sandbox-payment-gateway)
  • Enhancement: Requires Plugins: woocommerce header (WordPress 6.5+)

1.0.4

  • Compatibility: Tested with WordPress 6.8
  • WooCommerce: Refactored gateways to extend WC_Payment_Gateway with hardened input handling
  • DevOps: GitHub Action to auto-deploy WordPress.org assets

1.0.1

  • Initial release

License

This plugin is licensed under the GPLv2 or later.

About

WooCommerce Sandbox Payment Gateway eliminates the need to create coupons or test actual payment gateways with a real payment.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

 
 
 

Contributors

Languages