Testing Methods

❗️

Never Use Real Data

Never use real credit card or bank account information when testing.
The gateway provides several methods for testing transactions without sending any data to the credit card or ACH processor.


Sandbox Account

How it works

  • Log in to guide.nmi.com to retrieve Sandbox Keys or access the Sandbox Partner and Merchant Portals.
  • Build and test your integration.
  • All transactions are simulated; no charges are processed.

Best for

  • Full integration testing before going live.
  • Safe development without impacting production accounts.

Test Transaction

How it works

  • Set test_mode to "enabled" on a single transaction.
  • Use one of the Test Credit Card Numbers with expiration date 10/25.
  • Processes only that transaction in test mode; all other account transactions remain normal.

Example

{
  "security_key": "your_live_key",
  "test_mode": "enabled",
  "ccnumber": "4111111111111111",
  "ccexp": "1025"
}

Best for

  • Testing in a development environment while your live site processes real transactions.
  • Quickly validating a specific payment scenario.

Notes

  • Only available on live accounts (not supported in Sandbox).
  • To view in reporting, temporarily toggle account to test mode.

Demo Account

How it works

  • Use the Payment Gateway Demo Account — always available, no setup required.
  • Security key:
6457Thfj624V5r7WUwc5v6a68Zsd6YEm
  • Completely isolated from your own accounts.

Best for

  • Quick tests, training sessions, or demos.
  • Shared testing between teams or external partners.

Notes

  • Fully sandboxed—no actual processing occurs.
  • Safe to embed in code samples or documentation.

Test Mode

How it works

  • Toggle any merchant account into test mode.
  • All valid credit cards will be “approved” without actual charges or processing.

Best for

  • Testing all transactions in a controlled environment.
  • Bulk or repeated tests.

Notes

  • While in test mode, all transactions are simulated.
  • Avoid enabling in a live production environment serving customers.

Test Values

Card and ACH

Card TypeNumber
Visa4111111111111111
MasterCard5431111111111111
Discover6011000991300009
American Express341111111111111
Diner’s Club30205252489926
JCB3541963594572595
Maestro6799990100000000019
Other DetailsValue
Credit Card Expiration10/25
Account (ACH)24413815
Routing (ACH)490000018

Triggering Specific Responses

GoalHow to Trigger
Declined transactionAmount less than 1.00
Fatal errorInvalid card number
AVS matchAddress1 = 888, Zip = 77777
CVV matchCVV = 999

3D Secure (3DS) in Sandbox

Not Enrolled – Frictionless Flow

Cards return Enrolled: "N", skipping authentication.

Card TypeNumber
Visa4111111111111111
Mastercard5431111111111111
Amex341111111111111
Discover6799990100000000019

Expected:

  • cardholder_auth: "attempted"
  • CAVV: (empty)
  • ECIFlag: "07" (Not enrolled)

Frictionless Authentication Flow

Cards return Enrolled: "Y" with CAVV present.

Card TypeNumber
Visa4100000000000100
Mastercard5100000000000107
Amex340000000000108
Discover6440000000000104

Expected:

  • cardholder_auth: "verified"
  • CAVV: "mock_cavv_0002_1234567890"
  • ECIFlag: "05" (Authenticated)

Challenge Flow

Triggers a 3DS challenge with mock interaction.

Card TypeNumber
Visa4100000000005000
Mastercard5100000000005007
Amex340000000005008
Discover6440000000005004

Expected:

  • Enrolled: "Y"
  • PAResStatus: "C" (Challenge required)
  • ECIFlag: "02" (Challenge required)
  • User sees a mock challenge interface.

Challenge Actions

ResultAction
PassEnter code 12345
FailEnter any other code
CancelClose the challenge