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).
Successful charges
When making requests in test mode, you must use one of the following cards to simulate a successful charge.
Card number | Card type |
---|---|
4012000100000007 | Visa |
4242424242424242 | Visa |
4012888888881881 | Visa |
4000056655665556 | Visa (debit) |
4426034383518716 | Visa (GB) |
4909069612259316 | Visa (ES) |
5555555555554444 | MasterCard |
5200828282828210 | MasterCard (debit) |
5105105105105100 | MasterCard |
2222000000000008 | MasterCard |
5294008684328401 | Mastercard (GB) |
5125646148694267 | Mastercard (ES) |
6759649826438453 | Maestro |
378282246310005 | American Express |
371449635398431 | American Express |
6011111111111117 | Discover |
6011000990139424 | Discover |
30569309025904 | Diners Club |
38520000023237 | Diners Club |
3530111333300000 | JCB |
3566002020360505 | 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 number | Error code and description |
---|---|
4024007102349866 | invalid_number - The card number is not a valid one. |
4532873294814636 | invalid_expiry_month - The card's expiration month is invalid. |
4532582477951947 | invalid_expiry_year - The card's expiration year is invalid. |
4024007189368227 | invalid_cvc - Your card's security code is invalid. |
4916487051294548 | expired_card - The 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 number | Error code and description |
---|---|
4024007134364842 | incorrect_cvc - The card's security code failed verification. |
4929225021529113 | incorrect_zip - The card's zip code failed validation. |
4242000000000323 | incorrect_address - The card's address failed validation. |
4024007118468684 | insufficient_funds - The charge amount exceeds the available fund or the card's credit limit. |
4024007114621187 | lost_or_stolen - The card is marked as lost or stolen. |
4024007155502486 | suspected_fraud - The charge is suspected to be fraudulent. |
4916018475814056 | card_declined - The card was declined for another reason. |
4916449457024978 | authentication_required - The charge requires cardholder authentication. |
4024007114166316 | processing_error - An 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 number | Dispute type |
---|---|
4242000000000018 | Chargeback |
4242000000000026 | 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.
Fraud check
In test mode, you can test fraud check by creating charges with one of the following cards:
Card number | Fraud check result |
---|---|
4242000000000042 | Safe |
4242000000000059 | Suspicious |
4242000000000067 | Fraudulent |
4242000000000208 | Fraudulent (with fraud warning) |
4242000000000075 | Unknown |
3D Secure
In test mode, you can test 3D Secure by using one of the following cards:
Card number | 3D Secure check result | Card Scheme |
---|---|---|
4012001800000016 | Enrolled for 3D Secure 2 | Visa |
5428000221101226 | Enrolled for 3D Secure 2 | MasterCard |
3755221100001323 | Enrolled for 3D Secure 2 | American Express |
3628000221101229 | Enrolled for 3D Secure 2 | Diners Club |
6011000990191003 | Enrolled for 3D Secure 2 | Discover |
3528000111101116 | Enrolled for 3D Secure 2 | JCB |
all other test cards | Not enrolled for 3D Secure |
ANI check
In order to test ANI check, please use card number "4242000000000513" while performing the zero authentication with the following cardholder name
Cardholder name | ANI check result |
---|---|
Ani check | full_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 card number "4242000000000315" with the following zip codes
Cardholder name | ANI check result |
---|---|
00000 | full_match |
00001 | no_match |
00002 | partial_match |
00003 | not_provided |
CVV check
In order to test CVV check, please use card number "4111100000000006" with the following cvv codes
Cardholder name | CVV check result |
---|---|
111 | match |
222 | no_match |
333 | not_verified |
444 | not_provided |
555 | not_supported |
Credit
In test mode, you can test credit by using one of the following cards:
Card number | Credit result |
---|---|
4242000000011114 | Successful (with fast credit support) |
all other test cards | Successful |
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.
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.
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'}}
});
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:
Account number | Result |
---|---|
4242424242424242 | Account setup successfully |
1111222233339901 | Account verification fail |
1111222233338801 | Charge processing_error |
1111222233338802 | Charge insufficient_funds |
1111222233338803 | Charge payment_method_declined |
1111222233337701 | Refund error |
1111222233336602 | 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.
Number | Charge result |
---|---|
111001 | Success with 1 second delay |
111010 | Success with 10 seconds delay |
111060 | Success with 60 seconds delay |
999001 | Fail with 1 second delay |
999010 | Fail with 10 seconds delay |
999060 | 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 number | Charge result |
---|---|
48123456789 | Success with 1 second delay |
41123456789 | Success with 10 seconds delay |
46766962500 | Success with 60 seconds delay |
48987654321 | Fail with 1 second delay |
41987654321 | Fail with 10 second delay |
46764402400 | Fail with 60 second delay |