Skip to main content

Suma Test WooCommerce Gateway

Test-only WooCommerce payment gateway that forces deterministic approve or decline checkout outcomes for QA and integration testing.

Overview

Suma Test WooCommerce Gateway registers a payment method with ID suma_test_gateway and lets testers choose one of two outcomes during checkout:

  • Approve transaction
  • Decline transaction

The plugin does not connect to any payment processor. It is designed for non-production testing of checkout behavior, order state transitions, error handling, and custom hooks.

Version: 1.0.2
Requires at least: WordPress 6.9
Requires PHP: 7.4+
Primary class: WC_Gateway_Suma_Test

Primary Use Cases

  • Validate success and failure checkout paths in QA
  • Test order notes and metadata written on approval/decline
  • Exercise fraud and verification automation that listens to failed payment hooks
  • Verify gateway-specific email and thank-you behavior
  • Test integrations that rely on WooCommerce gateway lifecycle actions

Core Runtime Behavior

  1. Plugin loads on plugins_loaded and checks WooCommerce availability.
  2. Gateway class is registered via woocommerce_payment_gateways.
  3. Checkout renders required radio controls for outcome selection.
  4. On payment processing:
    • approve: order completes successfully and cart is emptied
    • decline: order is marked failed and failure hooks are fired
  5. Gateway emits custom actions before and after processing.

Safety and Scope

  • This gateway is for staging and local environments only.
  • No card network calls or remote processor requests are executed.
  • Do not enable this payment method in production checkout flows.

Next Steps