Testing

Logs

When you are testing your integration with Shift4, viewing request logs in your dashboard might be useful.

Test card numbers

When making requests in test mode, you must use one of the following cards to simulate a successful charge:

Card numberCard type
4012000100000007Visa
4242424242424242Visa
4012888888881881Visa
4000056655665556Visa (debit)
4426034383518716Visa (GB)
4909069612259316Visa (ES)
5555555555554444MasterCard
5200828282828210MasterCard (debit)
5105105105105100MasterCard
2222000000000008MasterCard
5294008684328401Mastercard (GB)
5125646148694267Mastercard (ES)
6759649826438453Maestro
378282246310005American Express
371449635398431American Express
6011111111111117Discover
6011000990139424Discover
30569309025904Diners Club
38520000023237Diners Club
3530111333300000JCB
3566002020360505JCB

Testing validation errors

You can use one of the following card numbers to test validation errors in test mode.

Errors can be simulated by creating a token, charge, or subscription.

Card numberError code and description
4024007102349866invalid_number - The card number is not a valid one.
4532873294814636invalid_expiry_month - The card's expiration month is invalid.
4532582477951947invalid_expiry_year - The card's expiration year is invalid.
4024007189368227invalid_cvc - Your card's security code is invalid.
4916487051294548expired_card - The card has expired.

Testing card processing errors

In test mode, you can use one of the following card numbers to test various error responses.

Errors can be simulated only by creating a charge or subscription. Note that creating a token won’t return an error.

Card numberError code and description
4024007134364842incorrect_cvc - The card's security code failed verification.
4929225021529113incorrect_zip - The card's zip code failed validation.
4242000000000323incorrect_address - The card's address failed validation.
4024007118468684insufficient_funds - The charge amount exceeds the available fund or the card's credit limit.
4024007114621187lost_or_stolen - The card is marked as lost or stolen.
4024007155502486suspected_fraud - The charge is suspected to be fraudulent.
4916018475814056card_declined - The card was declined for another reason.
4916449457024978authentication_required - The charge requires cardholder authentication.
4024007114166316processing_error - An error occurred while processing the card.
4242000000000083This card will only work when CVC is 123. Otherwise, it will return an incorrect_cvc error code.

Testing disputes

In test mode, you can test charge disputes by creating charges with one of the following cards:

Card numberDispute type
4242000000000018Chargeback
4242000000000026Retrieval request (soft chargeback)

Note that the charge created with one of those cards won't be disputed immediately after its creation. Usually, you need to wait about 1 minute for the charge to change its status to disputed.

When testing disputes, it is also possible to simulate different dispute flows. To do this, you must enter winning_evidence or losing_evidence text into the uncategorized_text field.

Testing fraud check

In test mode, you can test fraud check by creating charges with one of the following cards:

Card numberFraud check result
4242000000000042Safe
4242000000000059Suspicious
4242000000000067Fraudulent
4242000000000208Fraudulent (with fraud warning)
4242000000000075Unknown

Testing 3D Secure

In test mode, you can test 3D Secure by using one of the following cards:

Card number 3D Secure check resultCard Scheme
4012001800000016 Enrolled for 3D Secure 2Visa
5428000221101226Enrolled for 3D Secure 2MasterCard
3755221100001323Enrolled for 3D Secure 2American Express
3628000221101229Enrolled for 3D Secure 2Diners Club
6011000990191003Enrolled for 3D Secure 2Discover
3528000111101116Enrolled for 3D Secure 2JCB
all other test cards Not enrolled for 3D Secure

Testing credit

In test mode, you can test credit by using one of the following cards:

Card numberCredit result
4242000000011114Successful (with fast credit support)
all other test cardsSuccessful