Never Use Real DataNever 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 Type | Number |
---|---|
Visa | 4111111111111111 |
MasterCard | 5431111111111111 |
Discover | 6011000991300009 |
American Express | 341111111111111 |
Diner’s Club | 30205252489926 |
JCB | 3541963594572595 |
Maestro | 6799990100000000019 |
Other Details | Value |
---|---|
Credit Card Expiration | 10/25 |
Account (ACH) | 24413815 |
Routing (ACH) | 490000018 |
Triggering Specific Responses
Goal | How to Trigger |
---|---|
Declined transaction | Amount less than 1.00 |
Fatal error | Invalid card number |
AVS match | Address1 = 888 , Zip = 77777 |
CVV match | CVV = 999 |
3D Secure (3DS) in Sandbox
Not Enrolled – Frictionless Flow
Cards return Enrolled: "N"
, skipping authentication.
Card Type | Number |
---|---|
Visa | 4111111111111111 |
Mastercard | 5431111111111111 |
Amex | 341111111111111 |
Discover | 6799990100000000019 |
Expected:
cardholder_auth
:"attempted"
CAVV
: (empty)ECIFlag
:"07"
(Not enrolled)
Frictionless Authentication Flow
Cards return Enrolled: "Y"
with CAVV
present.
Card Type | Number |
---|---|
Visa | 4100000000000100 |
Mastercard | 5100000000000107 |
Amex | 340000000000108 |
Discover | 6440000000000104 |
Expected:
cardholder_auth
:"verified"
CAVV
:"mock_cavv_0002_1234567890"
ECIFlag
:"05"
(Authenticated)
Challenge Flow
Triggers a 3DS challenge with mock interaction.
Card Type | Number |
---|---|
Visa | 4100000000005000 |
Mastercard | 5100000000005007 |
Amex | 340000000005008 |
Discover | 6440000000005004 |
Expected:
Enrolled
:"Y"
PAResStatus
:"C"
(Challenge required)ECIFlag
:"02"
(Challenge required)- User sees a mock challenge interface.
Challenge Actions
Result | Action |
---|---|
Pass | Enter code 12345 |
Fail | Enter any other code |
Cancel | Close the challenge |