Test Credit and Debit Card Numbers for Every Payment API (2024)

Kyle Pollock for Rapyd

Posted on • Updated on • Originally published at community.rapyd.net

Test Credit and Debit Card Numbers for Every Payment API (4) Test Credit and Debit Card Numbers for Every Payment API (5) Test Credit and Debit Card Numbers for Every Payment API (6) Test Credit and Debit Card Numbers for Every Payment API (7) Test Credit and Debit Card Numbers for Every Payment API (8)

#paymentapi #api #payments #fintech

by Allan MacGregor

When building e-commerce solutions or working with payment processing systems, it’s vital to test the different transaction scenarios to ensure that the payment processing is working as expected. Testing your system to make sure it can handle scenarios where payment transactions fail also helps protect your business and your customers alike.

Payment transactions might fail due to a variety of reasons, and some of the most typical errors include the following:

  • Do not honor
  • Insufficient funds
  • Stolen credit card
  • Identity verification error

You might be wondering, "How do I test these scenarios? Should I use a test card number or an actual card number?”

Although credit card companies have a reserved Bank Identification Number or BIN for test credit cards in an attempt to provide a quasi-universal standard of testing card numbers that can be used on any payment, not all payment gateways follow this convention.

It's always recommended to check your gateway processor for details on the numbers and scenarios they support. Needless to say, test card numbers will only work on sandbox accounts, and fail on live payment gateways. Additionally, enabling sandbox mode will vary from payment processor to payment processor, so it’s recommended to consult their official documentation for more information.

This article provides a list of test credit and debit card numbers that will work on most payment processors and elaborates on the specific scenarios that these numbers will simulate.

Testing Credit and Debit Card Numbers

While there’s a wide variety of situations for testing your payment API, typically you’ll want to cover at least the following scenarios:

  • Successful transactions.
  • Payment errors like do not honor, insufficient funds, and stolen cards.
  • Cardholder disputes.
  • Testing 3D Secure

The numbers and setup discussed in this article are specific to Rapyd payments, but the numbers should work on most APIs and the steps should also be much the same.
<!--HubSpot Call-to-Action Code --><!--[if lte IE 8]><![endif]-->Test Credit and Debit Card Numbers for Every Payment API (9) hbspt.cta.load(5246303, &#39;5fd0724d-a725-4f12-84ac-23227175b99a&#39;, {&quot;useNewLoader&quot;:&quot;true&quot;,&quot;region&quot;:&quot;na1&quot;}); <!-- end HubSpot Call-to-Action Code -->

Numbers for Successful Transactions

A successful transaction is the most typical scenario that you might want to test. Testing a successful translation is useful to confirm that the final stages of your flow are working correctly, like confirmation pages and emails, order reviews, and so on. You can simulate a successful transaction using the following numbers, which will work on any payment processor.

Card NumberCVVExp. DateAmountScenario
4111111111111111AnyAny future dateAnySuccessful Transaction
4462030000000000AnyAny future dateAnySuccessful Transaction

Numbers for Error Transactions

Knowing how your system will handle errors that lead to declined transactions is vital. Transaction errors occur as transactions are being processed, for example, during checkout in an e-commerce store, and typically fall into one of the following categories:

  • Do not honor: Also called an invalid service code error, this indicates that the customer's issuing bank will not validate the transaction with the authorization code provided. There are several possible reasons for this error:

    • The customer has a hold on their card.
    • The card has had multiple denied payments in a row, so it’s temporarily locked.
    • The merchant is operating in a different country than the customer.
    • The transactions were flagged by the bank's anti-fraud system.
  • Stolen card: This indicates that the card has been reported as stolen. If operating in a retail store, the recommended process is to retain the card, deny any goods or services, and immediately call the card issuer.

  • Insufficient funds: The card doesn't have the necessary funds to complete the transaction. This is applicable to credit cards and debit cards.

The numbers for simulating these transaction errors are as follows:

Card NumberCVVExp. DateAmountScenario
4111111111111105AnyAny future dateAnyDo not honor
4111111111111143AnyAny future dateAnyStolen card
4111111111111151AnyAny future dateAnyInsufficient funds

In addition to the above numbers, you can also use a specific transaction amount to simulate the following errors:

  • Payment gateway not responding: This error simulates the payment gateway not responding to the request due to an internal error.
  • Payment expired: Simulates a scenario where the transaction cannot be processed because the payment has expired.
  • Insufficient funds: Simulates an instance of the test credit card not having enough funds to complete the transaction.
  • Processor unavailable: Simulates the payment processor not being available and the transaction failing as result of a network error.
  • Settlement decline: Simulates the transaction failing due to an instance where the payment could not be processed because the settlement amount was declined.

The following table contains the test numbers along with the transaction amount ranges you must enter to simulate these particular errors.

Card NumberCVVExp. DateAmount (in cents)Scenario
4111111111111111AnyAny future date2000 - 2009Settlement decline
4111111111111111AnyAny future date2080 - 2089Processor unavailable
4111111111111111AnyAny future date2120 - 2129Insufficient funds
4111111111111111AnyAny future date2180 - 2189Payment expired
4111111111111111AnyAny future date4000 - 4009Payment gateway not responding

Numbers for Cardholder Disputes

Cardholder disputes is another category of tests that you should consider running on your e-commerce or payment processing system. These occur when the initial transaction has been processed, and the cardholder is then disputing the transaction.

Normally, the customer will open a dispute through their credit card company and the business will receive notification of the dispute and be offered a chance to refute the claim. Cardholder disputes typically fall under one of the following categories:

  • Goods or services not provided: This error indicates that the customer has not received the goods or services they ordered, so they’re disputing the transaction with their credit card company.
  • Subscription canceled: For SaaS companies, customers will often dispute subscription payments claiming the subscription had been canceled.
  • Counterfeit merchandise: This simulates an instance of a fraudulent transaction where the customer claims the merchandise is counterfeit.
  • Credit not processed: A common case for retailers is when customers claim to have a receipt for credit or a voided transaction, but have not yet had their credit processed.

  • Cardholder dispute - miscellaneous: Simulates a generic dispute where the customer has a dispute with the credit card company, but no specific reason is attached.

The numbers for simulating these cardholder disputes are as follows.

Card NumberCVVExp. DateAmount (in cents)Scenario
4539922288211219AnyAny future dateAnyGoods or services not provided
4556028624137080AnyAny future dateAnySubscription canceled
4556942399248726AnyAny future dateAnyCounterfeit merchandise
5374500863109043AnyAny future dateAnyCredit not processed
5132803130357186AnyAny future dateAnyCardholder dispute - miscellaneous

Testing 3D Secure

Another important aspect of credit card processing that’s worth implementing and testing is 3D Secure, or 3DS. This is a feature that verifies the identity of the cardholder before allowing them to complete a transaction, with the aim of adding another layer of security to your payment processing system.

Different payment processors implement 3DS as different products, for example:

  • MasterCard SecureCode
  • Verified by Visa
  • Discover ProtectBuy

With Rapyd, we can simulate 3DS authentication for the following Rapyd Payment API operations:

  • Create payment: Set amount to 1000 or above, while avoiding the amounts listed in the 2000 range for error transactions.
  • Create customer: This request will require 3DS for all payment methods.
  • Add payment method to customer: This request will require 3DS for all payment methods.

Let's go ahead with the API request to create a payment with a 3DS-enabled verification:

Request URL: POST https://sandboxapi.rapyd.net/v1/payments

{ "amount": 1100, "currency": "USD", "payment_method": { "type": "us_visa_card", "fields": { "number": "4111111111111111", "expiration_month": "12", "expiration_year": "25", "cvv": "789", "name": "John Doe" } }, "capture": true}

Once you receive the response, you can check the status, redirect_url, and next_action fields to validate the response and simulate the 3DS redirection flow. For example:

{ "status": { "error_code": "", "status": "SUCCESS", "message": "", "response_code": "", "operation_id": "42416643-4159-49a8-8c65-4a17e8d4e489" }, "data": { "id": "payment_46bd13214fe6e7ab9f12f70e64d5743c", "amount": 0, "original_amount": 1050, "is_partial": false, "currency_code": "USD", "country_code": "US", "status": "ACT", // ... "payment_method": "card_761c1a5ce9b7af77f5f6cd539fb1fcbb", "payment_method_data": { "id": "card_761c1a5ce9b7af77f5f6cd539fb1fcbb", "type": "us_visa_card", "category": "card", // ... "next_action": "3d_verification" }, // ... "redirect_url": "https://sandboxcheckout.rapyd.net/3ds-payment?token=payment_46bd13214fe6e7ab9f12f70e64d5743c", // ... "next_action": "3d_verification", // ... },}

Looking at the data section of the response, you can see that the next_action field is set to 3d_verification. This means that the payment processor has requested a 3DS authentication:

  • status: The status of the payment is ACT (active). The payment is active and awaiting completion of 3DS authentication.
  • redirect_url: The URL for 3DS authentication.
  • next_action: The value is 3d_verification. 3DS authentication is required to complete the payment.

As part of the testing, you can open the redirect_url in a new tab and complete the 3DS authentication. Once you open the URL in the browser, you should see the following.

Test Credit and Debit Card Numbers for Every Payment API (10)

From this page, we can simulate the following:

  • 3DS failure: By clicking the Cancel button.
  • 3DS success: By clicking the Continue button.

Conclusion

In this article, you learned the importance of testing your payment processing system regardless of whether you’re a merchant, a SaaS company, or a retailer; testing will ensure your system can correctly process credit and debit cards and protect you against fraud. You also learned about some of the challenges involved with testing your payment processing system and the existence of test credit and debit card numbers.

While every payment processor has their own set of test credit and debit card numbers, and the testing scenarios they support vary, most will support the scenarios we covered in this article.

This article simulated these transactions and errors using Rapyd Payment API, a payment processing API that makes payment processing from a myriad payment methods, such as credit cards, debit cards, and e-wallets, fast and easy.

Test Credit and Debit Card Numbers for Every Payment API (2024)

FAQs

What card number is 4111 1111 1111 1111 CVV? ›

What credit card should we be testing with? Only pre-approved 'test card' numbers provided by Windcave can be used for testing, within test environments. We recommend using the test card 4111 1111 1111 1111 for Visa, 5431 1111 1111 1111 for MasterCard, 3711 1111 1111 114 for Amex, and 3600 0000 0000 08 for Diners.

What is the dummy code for American Express? ›

Amex dummy Card number = 37 999 999 999 999 4.

What is the universal CVV code? ›

Most card issuers use a three-digit code on credit and debit cards, including VISA, Mastercard, and Discover. But American Express uses a four-digit CVV. Each CVV is unique to the card and account holder, meaning there's no universal CVV code.

Can you test API manually? ›

Is API testing manual or automated? API testing can be either manual or automated. Manual API testing involves manually sending requests to an application's interface and verifying the responses, while automated API testing utilizes specialized software tools to send requests and validate responses.

What is a payment tester? ›

Payment testing involves verifying the accuracy and integrity of financial transactions by performing a series of tests with various payment methods, including credit cards, debit cards, and online payments.

Are test card numbers illegal? ›

A: Yes, misusing test credit card numbers or attempting to use them for fraudulent purposes can result in legal consequences.

Is 378282246310005 a valid credit card number? ›

For test transactions, you can use any of the following numbers: American Express - 378282246310005 (Use any 4-digit number for the Card Security Code)

What is a 6011 card number? ›

6011 – The 6011 prefix is famously linked to Discover cards. This series indicates that the card is part of the Discover network, known for cash back rewards and a user-friendly approach to credit management.

What is the algorithm to validate a credit card number? ›

Before a credit card transaction is processed, the card number can be checked using the Luhn algorithm to confirm that it's a valid sequence. This step helps detect accidental input errors or incomplete numbers.

What is the mod 10 algorithm for credit cards? ›

The Luhn Algorithm—also known as the “Modulus 10 Algorithm”—is a formula that is used to determine whether the identification number provided by a user is accurate. The formula is widely used in validating credit card numbers, as well as other number sequences such as government Social Security Numbers (SSNs).

What is the algorithm for debit cards? ›

The Luhn algorithm works by summing up every other digit in the identification number, starting from the rightmost digit, and then doubling the value of every other digit and summing up the individual digits of the doubled values.

What credit card starts with 4400? ›

4400 – This prefix is commonly associated with Visa branded debit and credit cards issued by various banks. Cards that start with 4400 are part of Visa's extensive network and are widely accepted both domestically and internationally. 5466 – Credit cards that begin with 5466 are typically MasterCard products.

What is the format of a diners club credit card number? ›

Credit Card Number (Diner's Club) is a 14-digit number beginning with 300–305, 36, 38, or 39 and might have dashes (hyphens) or spaces as separators. For example, NNNN-NNNNNN-NNNN or NNNN NNNNNN NNNN.

What is the ccv2 card number? ›

The 3 or 4 digit Security Code (CVV2) can be found on the back of your credit card. For American Express, the Security Code (CID) can be found on the front of the card.

What number does Visa CVV start with? ›

Visa®, Mastercard®, and Discover® cardholders:

You should see either the entire 16-digit credit card number or just the last four digits followed by a special 3-digit code. This 3-digit code is your CVV number / Card Security Code.

Top Articles
Boeing scrubs launch of first crewed mission for Starliner spacecraft | CNN
Slovakia beat Belgium live updates
Funny Roblox Id Codes 2023
Golden Abyss - Chapter 5 - Lunar_Angel
Www.paystubportal.com/7-11 Login
Joi Databas
DPhil Research - List of thesis titles
Shs Games 1V1 Lol
Evil Dead Rise Showtimes Near Massena Movieplex
Steamy Afternoon With Handsome Fernando
Which aspects are important in sales |#1 Prospection
Detroit Lions 50 50
18443168434
Zürich Stadion Letzigrund detailed interactive seating plan with seat & row numbers | Sitzplan Saalplan with Sitzplatz & Reihen Nummerierung
Grace Caroline Deepfake
978-0137606801
Nwi Arrests Lake County
Justified Official Series Trailer
London Ups Store
Committees Of Correspondence | Encyclopedia.com
Pizza Hut In Dinuba
Jinx Chapter 24: Release Date, Spoilers & Where To Read - OtakuKart
Obsidian Guard's Cutlass
Marvon McCray Update: Did He Pass Away Or Is He Still Alive?
Mccain Agportal
Amih Stocktwits
Fort Mccoy Fire Map
Uta Kinesiology Advising
Kcwi Tv Schedule
What Time Does Walmart Auto Center Open
Nesb Routing Number
Olivia Maeday
Random Bibleizer
10 Best Places to Go and Things to Know for a Trip to the Hickory M...
Black Lion Backpack And Glider Voucher
Gopher Carts Pensacola Beach
Duke University Transcript Request
Lincoln Financial Field, section 110, row 4, home of Philadelphia Eagles, Temple Owls, page 1
Jambus - Definition, Beispiele, Merkmale, Wirkung
Netherforged Lavaproof Boots
Ark Unlock All Skins Command
Craigslist Red Wing Mn
D3 Boards
Jail View Sumter
Nancy Pazelt Obituary
Birmingham City Schools Clever Login
Thotsbook Com
Funkin' on the Heights
Vci Classified Paducah
Www Pig11 Net
Ty Glass Sentenced
Latest Posts
Article information

Author: Patricia Veum II

Last Updated:

Views: 5937

Rating: 4.3 / 5 (44 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Patricia Veum II

Birthday: 1994-12-16

Address: 2064 Little Summit, Goldieton, MS 97651-0862

Phone: +6873952696715

Job: Principal Officer

Hobby: Rafting, Cabaret, Candle making, Jigsaw puzzles, Inline skating, Magic, Graffiti

Introduction: My name is Patricia Veum II, I am a vast, combative, smiling, famous, inexpensive, zealous, sparkling person who loves writing and wants to share my knowledge and understanding with you.