Skip to content
Docs

Testing

Introduction

In test mode, you can run transactions with special testing values to verify your integration without actual money movement.

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

Testing cards

Our test numbers base on assumption that expiration date is any date in the future. CVC number consists of 3 or 4 digits of your choice unless testing cvc error (see the last position in Testing card processing errors).

Cards successful charges

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

Card numberCard type
Visa
Visa
Visa
Visa (debit)
Visa (GB)
Visa (ES)
MasterCard
MasterCard (debit)
MasterCard
MasterCard
Mastercard (GB)
Mastercard (ES)
Maestro
American Express
American Express
Discover
Discover
Diners Club
Diners Club
JCB
JCB

Card 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 codeDescription
invalid_numberThe card number is not a valid one.
invalid_expiry_monthThe card's expiration month is invalid.
invalid_expiry_yearThe card's expiration year is invalid.
invalid_cvcYour card's security code is invalid.
expired_cardThe card has expired.

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 codeDescription
incorrect_cvcThe card's security code failed verification
incorrect_zipThe card's zip code failed validation
incorrect_addressThe card's address failed validation
insufficient_fundsThe charge amount exceeds the available fund or the card's credit limit
lost_or_stolenThe card is marked as lost or stolen
suspected_fraudThe charge is suspected to be fraudulent
card_declinedThe card was declined for another reason
authentication_requiredThe charge requires cardholder authentication
processing_errorAn error occurred while processing the card
-This card will only work when CVC is 123. Otherwise, it will return an incorrect_cvc error code

Disputes

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

Card numberDispute type
Chargeback
Retrieval 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 in API or additional details field in the dispute form in the dashboard.

Fraud check

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

Card numberFraud check result
Safe
Suspicious
Fraudulent
Fraudulent (with fraud warning)
Unknown

3D Secure

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

Card number3D Secure check resultCard Scheme
Enrolled for 3D Secure 2Visa
Enrolled for 3D Secure 2MasterCard
Enrolled for 3D Secure 2American Express
Enrolled for 3D Secure 2Diners Club
Enrolled for 3D Secure 2Discover
Enrolled for 3D Secure 2JCB
all other test cardsNot enrolled for 3D Secure

ANI check

In order to test ANI check, please use the following card number while performing the zero authentication:

Card number

And use the cardholder name from the following list:

Cardholder nameANI check result
Ani checkfull_match
Ani <random string>partial_match
<random string> checkpartial_match
<random string>no_match

AVS check

In order to test AVS check, please use the following card number:

Card number

And use the zip code from the following list:

Zip codeAVS check result
full_match
no_match
partial_match
not_provided

CVV check

In order to test CCV check, please use the following card number:

Card number

And use the CCV from the following list:

CVV codeCVV check result
match
no_match
not_verified
not_provided
not_supported

Credit

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

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

Testing wallets

Apple Pay

You can simulate Apple Pay transactions without real card numbers, since tokens already include the required information. To create a test transaction, send one of the following tokens. Make sure to include the charge amount in the token. All transactions created with Apple Pay include a 3DS liability shift.

TokenFraud check resultCharge statusExample with charge amount
TEST_TOKENSafeSuccessfulTEST_TOKEN:1000EUR
TEST_FRAUDULENT_TOKENFraudulentSuccessfulTEST_FRAUDULENT_TOKEN:1000EUR
TEST_SUSPICIOUS_TOKENSuspiciousSuccessfulTEST_SUSPICIOUS_TOKEN:1000EUR
TEST_DECLINE_TOKEN-DeclinedTEST_DECLINE_TOKEN:1000EUR

The tokens can be used in the payment method request body as follows:

{ "type": "apple_pay", "applePay": { "token": "TEST_TOKEN:100EUR" } }

The tokens can also be used in shift4.js in place of a real Apple Pay token, as shown below:

await shift4.createToken({
    methodName: 'https://apple.com/apple-pay',
    details: {token: {paymentData: 'TEST_TOKEN:1000EUR'}}
});

Want to lean more about Apple Pay? Visit Apple Pay integration example along with the technical specifications.

Google Pay

You can simulate Google Pay transactions without real card numbers, since tokens already include the required information. Note, that most card issuers require 3DS for Google Pay transactions. To create a test payment, use one of the tokens listed below:

  • PAN_ONLY tokens – Merchants must run 3DS themselves.
  • CRYPTOGRAM_3DS tokens – Already include the 3DS result provided by Google Pay.

For testing purposes, two special PAN_ONLY tokens do not support or require 3DS.

TokenFraud check resultCharge status3DS
PAN_ONLYSafeDepends on 3DS resultRequired
PAN_ONLY_SUSPICIOUSSuspiciousDepends on 3DS resultRequired
PAN_ONLY_FRAUDULENTFraudulentDepends on 3DS resultRequired
PAN_ONLY_DECLINED-DeclinedRequired
PAN_ONLY_3DS_UNSUPPORTEDSafeSuccessfulUnsupported (e.g. prepaid card)
PAN_ONLY_3DS_NOT_REQUIREDSafeDepends on 3DS resultNot required (e.g. card issuer allowing transactions without 3DS)
CRYPTOGRAM_3DSSafeSuccessfulNot applicable, included in Google Pay token
CRYPTOGRAM_3DS_SUSPICIOUSSuspiciousSuccessfulNot applicable, included in Google Pay token
CRYPTOGRAM_3DS_FRAUDULENTFraudulentSuccessfulNot applicable, included in Google Pay token
CRYPTOGRAM_3DS_DECLINED-DeclinedNot applicable, included in Google Pay token

The tokens can be used in the payment method request body as follows:

{ "type": "google_pay", "googlePay": { "token": "CRYPTOGRAM_3DS" } }

The tokens can also be used in shift4.js in place of a real Google Pay token, as shown below:

await shift4.createToken({
    methodName: 'https://google.com/pay',
    details: {paymentMethodData: {tokenizationData: {token: 'PAN_ONLY'}}}
});

Find more about SCA and Google Pay API.

Want to lean more about Google Pay? Visit Google Pay integration example along with the technical specifications.

Testing payment methods

ACH with bank account details

When you create PaymentMethod using account details received from customer it is not yet ready to be Charged. PaymentMethod would have status "pending". Verification process of such account can take up to a week. In Test mode account will be verified and PaymentMethod will became chargeable in a few seconds to simplify testing.

To finish test PaymentMethod setup one can enter following data:

FieldValue
Routing number
Account typePersonal Savings

And select account testing number from the following list:

Account numberResult
Account setup successfully
Account verification fail
Charge processing_error
Charge insufficient_funds
Charge payment_method_declined
Refund error
Triggers charge dispute

Want to lean more about ACH? Visit ACH with bank account integration example and ACH with Plaid integration example along with the technical specifications.

Blik with Code

Here are some testing examples for Blik with code number. When processing live with this method, payment results may take longer than in the test mode. For this reason, in test mode, you can use predefined codes to simulate success or failure, with different delays before the final result appears.

NumberCharge result
Success with 1 second delay
Success with 10 seconds delay
Success with 60 seconds delay
Fail with 1 second delay
Fail with 10 seconds delay
Fail with 60 seconds delay

Want to lean more about Blik? Visit Blik integration example with full technical spec.

Swish

Here are some testing examples for phone number entry. When processing live with this method, payment results may take longer than in the test mode. For this reason, in test mode, you can use predefined codes to simulate success or failure, with different delays before the final result appears.

Phone numberCharge result
Success with 1 second delay
Success with 10 seconds delay
Success with 60 seconds delay
Fail with 1 second delay
Fail with 10 second delay
Fail with 60 second delay

Want to lean more about Swish? Visit Swish integration example with full technical spec.