Cartes de test et résultats de la passerelle de démonstration

The demo gateway is a simulated payment gateway that runs only on dev and stage. Attach it to a site like any other gateway; its payments then decline, time out, settle, return and charge back on demand, with no processor account.

Card numbers choose only the brand and funding. The outcome comes from the payment's amount: a pre-fee total ending in .45 cents picks an outcome by its dollar part, and any other total approves.

Test cards

Any expiry date in the future and any CVV work.

Card number
Brand
Funding
4242424242424242
Visa
credit
4000056655665556
Visa
debit
4000620000000007
Visa
commercial
4111111111111111
Visa
credit
5555555555554444
Mastercard
credit
2223003122003222
Mastercard
credit
5200828282828210
Mastercard
debit
5105105105105100
Mastercard
prepaid
378282246310005
Amex
credit
6011111111111117
Discover
credit
3056930009020004
Diners
credit
3566002020360505
JCB
credit
6200000000000005
UnionPay
credit

Any other valid number approves too. It gets the brand of its range and credit funding: 4 Visa; 51-55 and 2221-2720 Mastercard; 34 and 37 Amex; 6011, 644-649 and 65 Discover; 300-305, 3095, 36, 38 and 39 Diners; 3528-3589 JCB; any other 62 UnionPay. Debit and prepaid cards get the debit treatment; a commercial card is credit and Level 3 eligible.

Outcome amounts

The amount that picks the outcome is the payment's pre-fee total ( totals.total ): tax included, but no surcharge or other site fees, tip, late fees or early-pay discounts. A refund or a void uses the total of the payment it refunds or voids. Card bands also apply to Apple Pay and Google Pay.

Pre-fee total
Payment types
Outcome
Any total without .45 cents
All
Approves.
2000.45 - 2999.45
Card
Declined. The processor code is the dollar part, mapped to a decline category as listed under Decline codes.
3000.45
Card
Processor network unavailable: TryAgain.
3001.45
Card
No response. The simulator outwaits the 5 second request timeout: NoResponse.
3002.45
Card
Card issuer timed out: CardIssuerTimedOut.
3003.45
Card
HTTP 503. An unanswered request carries no code: NoResponse.
3004.45
Card
HTTP 429 rate limited: TryAgain.
3005.45
Card
HTTP 401, merchant credentials rejected: GatewayConfigurationError.
4001.45 - 4999.45
Card, ACH, EFT
Approves, then settlement is declined with the dollar part as its code. An ACH or EFT payment records it as a return.
5001.45 - 5085.45
ACH
Approves, then returns with R01 - R85 after settlement (5001.45 is R01, 5085.45 is R85).
5100.45
ACH, EFT
Bank account rejected at once: InvalidACH.
5101.45
ACH, EFT
Routing number rejected at once: InvalidRoutingNumber.
5102.45
ACH, EFT
Account number rejected at once: InvalidAccountNumber.
5103.45
ACH, EFT
Routing or account number rejected at once: InvalidRoutingOrAccountNumber.
5900.45 - 5990.45
EFT
Approves, then returns with CPA code 900 - 990 after settlement (5905.45 is 905).
6000.45 - 6099.45
Card
Approves, then is charged back. 6010.45 is Visa 10.4, 6013.45 Visa 13.1, 6048.45 Mastercard 4853 and 6083.45 Visa 83; any other total in the band is a generic chargeback whose code is the dollar part.
7001.45
Card, ACH, EFT
A refund of the payment is declined at once: Declined.
7002.45
Card, ACH, EFT
A void of the payment is declined: Declined.
7003.45
Card
Approves 50% of the amount: partial approval.
7004.45
Card, ACH, EFT
A refund of the payment succeeds, then fails later (refundFailed).
8001.45 - 8006.45
Card present
The terminal fails; see Card present.
32.74
All
Generic decline kept from the old demo gateway: Declined.

Decline codes

A total from 2000.45 to 2999.45 declines with Braintree's processor code equal to its dollar part. These are the codes most demos need:

Code
Decline category
2000, 2057
DoNotHonor
2001
InsufficientFunds
2004
ExpiredCard
2005
Invalid
2010
InvalidCvv
2012, 2013
CardLostOrStolen
2014
Fraud
2015
CardNotAccepted
2016
Duplicate
2017, 2018
RecurringStopped
2044, 2047
DoNotRetry

Every other code maps to the category its meaning matches:

Decline category
Codes
InsufficientFunds
2035
InsufficientFundsDelete
2002, 2003
ExpiredCard
2022
Invalid
2006, 2008, 2009, 2029, 2051, 2093, 2107
AccountClosed
2007, 2075, 2108
DoNotRetry
2011, 2020, 2041, 2043
CardLostOrStolen
2053
Fraud
2021, 2077
CardNotAccepted
2019, 2024, 2032, 2058, 2082
Duplicate
2069
RecurringStopped
2070
GatewayConfigurationError
2023, 2025, 2026, 2028, 2030, 2031, 2040, 2042, 2045, 2049, 2052, 2055, 2062, 2063, 2064, 2066, 2068, 2079, 2080, 2087, 2088, 2089, 2091, 2100
TransactionAmountTooSmall
2048
TransactionAmountTooLarge
2056, 2086, 2097
TryAgain
2034, 2078, 2105, 2106
InvalidAddress
2059
InvalidZipcode
2060
Declined
every other code, including all of 2109 - 2999

AVS and CVV

AVS is matched on the first five digits of the billing ZIP, so a ZIP+4 behaves the same:

  • 20000 answers AVS N (does not match).
  • 20001 answers AVS U (not verified).
  • Any other ZIP answers AVS M (matches).

CVV always answers M , whatever is entered. To test a CVV decline, use the 2010.45 total (InvalidCvv).

When the demo gateway's Enforce AVS setting is on, an AVS result of N turns an approval into an InvalidZipcode rejection. U never declines. ACH and EFT payments carry no AVS or CVV result.

ACH and EFT

Any routing and account number works; the outcome comes from the amount alone. These numbers pass the payment forms' checks:

Payment type
Test account
ACH
Routing number 110000000 , account number 000123456789 , checking
EFT
Institution number 001 , transit number 12345 , account number 1234567 , checking

An approved ACH or EFT payment stays captured until it settles. A return from the 5001.45 or 5900.45 bands follows that settlement.

Card present

The simulated terminals, Demo Countertop Terminal ( DEMO-T1 ) and Demo Handheld Terminal ( DEMO-T2 ), are interchangeable. Each read is a chip read of a Visa card ending in 1111 (BIN 411111) named DEMO CARDHOLDER. When the site has tipping on, the cardholder picks the first suggested tip, or 15% when none is suggested.

A card-present charge reads its outcome from the pre-fee total before the tip. The card bands above apply to the card it reads, and these totals make the terminal itself fail:

Pre-fee total
Terminal
Error category
8001.45
The cardholder cancels on the terminal.
PaymentDeviceAborted
8002.45
The terminal waits about 20 seconds for a card, then times out.
PaymentDeviceTimeout
8003.45
The terminal is offline.
PaymentDeviceNotConnected
8004.45
The terminal cannot read the chip.
PaymentDeviceChipReadError
8005.45
The terminal is busy with another transaction.
PaymentDeviceInUse
8006.45
The terminal is in the wrong mode.
PaymentDeviceInWrongMode

Event speed

Settlement, returns, chargebacks, refund settlement and authorization expiry happen later, on a schedule set by the demo gateway's speed: Instant (the default for a new gateway), Fast or Realistic. Instant and Fast wait a fixed time from the moment the event is scheduled, so a return comes that long after the payment settles. Realistic follows the calendar in the site's time zone with a 02:00 cutoff.

Event
Instant
Fast
Realistic
Settlement
5 seconds
1 minute
02:00 the day after capture
Settlement decline (4001.45 - 4999.45)
5 seconds
1 minute
02:00 the day after capture
ACH or EFT return
5 seconds
2 minutes
02:00, 2 to 5 business days after capture
Chargeback
5 seconds
3 minutes
02:00, 7 days after capture
Refund settles
5 seconds
1 minute
02:00 the day after the refund
Refund fails (7004.45)
5 seconds
1 minute
02:00 the day after the refund
Uncaptured authorization expires
5 minutes
30 minutes
7 days

Each event reaches Hyfin by a signed webhook and through the nightly batch poll. A settled payment joins the site's open batch, which closes at the next 02:00 in the site's time zone.

Trigger an event now

To skip the wait, open a demo gateway payment and use its Simulate panel, which also lists the payment's scheduled events and webhook deliveries. Each action shows only while the payment is in a status it applies to, and fires whatever the payment's amount. The panel calls POST /app/payment/{payment_id}/demo/{action} ; settlement declines, returns and chargebacks send their code as {"code": "R01"} .

Action
Button
Effect
settle
Settle now / Settle refund
Settles a captured payment, or a refund.
settlementDecline
Decline settlement
Declines settlement with a code from 4001 to 4999.
return
Return
Returns an ACH payment with R01 - R85, or an EFT payment with CPA code 900 - 990.
chargeback
Chargeback
Charges back a card payment with reason 10.4, 13.1, 4853 or 83.
failRefund
Fail refund
Fails a refund that has not settled.
expire
Expire authorization
Expires an uncaptured authorization.
cancel
Cancel
Cancels an uncaptured authorization.

An admin can also close the site's open batch at once with POST /app/paymentGateway/{gateway_id}/demo/closeBatch , which queues the site's batch job.