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
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


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
4024007102349866invalid_numberThe card number is not a valid one.
4532873294814636invalid_expiry_monthThe card's expiration month is invalid.
4532582477951947invalid_expiry_yearThe card's expiration year is invalid.
4024007189368227invalid_cvcYour card's security code is invalid.
4916487051294548expired_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
4024007134364842incorrect_cvcThe card's security code failed verification
4929225021529113incorrect_zipThe card's zip code failed validation
4242000000000323incorrect_addressThe card's address failed validation
4024007118468684insufficient_fundsThe charge amount exceeds the available fund or the card's credit limit
4024007114621187lost_or_stolenThe card is marked as lost or stolen
4024007155502486suspected_fraud The charge is suspected to be fraudulent
4916018475814056card_declinedThe card was declined for another reason
4916449457024978authentication_requiredThe charge requires cardholder authentication
4024007114166316processing_errorAn error occurred while processing the card
4242000000000083-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
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 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
4242000000000042Safe
4242000000000059Suspicious
4242000000000067Fraudulent
4242000000000208Fraudulent (with fraud warning)
4242000000000075Unknown

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

ANI check

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

Card number
4242000000000513

And use the cardholder name from the following list:

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

AVS check

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

Card number
4242000000000315

And use the zip code from the following list:

Cardholder nameANI check result
00000full_match
00001no_match
00002partial_match
00003not_provided


CVV check

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

Card number
4111100000000006

And use the CCV from the following list:

CVV codeCVV check result
111match
222no_match
333not_verified
444not_provided
555not_supported

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

Testing wallets

Apple Pay

vector image

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

vector image

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

vector image

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:

Routing number
021000021
Account type
Personal Savings

And select account testing number from the following list:

Account numberResult
4242424242424242Account setup successfully
1111222233339901Account verification fail
1111222233338801Charge processing_error
1111222233338802Charge insufficient_funds
1111222233338803Charge payment_method_declined
1111222233337701Refund error
1111222233336602Triggers 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

vector image

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
111001Success with 1 second delay
111010Success with 10 seconds delay
111060Success with 60 seconds delay
999001Fail with 1 second delay
999010Fail with 10 seconds delay
999060Fail with 60 seconds delay


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

Swish

vector image

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
48123456789Success with 1 second delay
41123456789Success with 10 seconds delay
46766962500Success with 60 seconds delay
48987654321Fail with 1 second delay
41987654321Fail with 10 second delay
46764402400Fail with 60 second delay

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