How to Generate Test Card Numbers That Actually Work

Our Cards

Choose from any of our gift cards to give to your loved ones

generate test card numbers

giftcardimage

Where to Use?

Redeem your gift cards at any of our Merchants

test credit card generator

Where to Buy?

You can purchase a gift card from any of these locations

generate test card numbers

ABOUT US

about

What is ONYX GiftCards?

Onyx Gift Cards is a Grenadian company designed to introduce, market and manage gift cards systems in Grenada for retailers and corporations. We are enthusiastic about the effect and influence we will have on the local market. We intend to expand our systems regionally with a range of product offerings and services.

What is a Gift Card?

Gift cards are the preferred way of giving and receiving gifts. They carry a monetary value that can be redeemed for gifts at your favorite store.
Onyx GiftCards are “Open Gift Cards” which means that they can be redeemed at multiple merchant locations. They are standard credit card size, can fit into the average wallet and made of PVC plastic. Onyx GiftCards are Barcoded for security and safety for the consumer and bear a disclaimer at the back.
Onyx Giftcards can be bought with a branded Card backer which is black in colour and is designed to fit the card. There is an area to write a brief message to the recipient as well.

How it Works?

  • Buy an Onyx Gift Card at these local stores
  • Give your gift card to friends, family, co-workers, etc.
  • The recipient can shop at our select merchants nationwide
  • Your friends, family, co-workers, etc. will present their gift card at checkout to pay for your item(s)
  • They will walk away happy with the best gift ever...the gift of Choice

Why ONYX GiftCards?

  • Save TIME. No need to run around looking for the perfect gift
  • Redeem from a variety of business island-wide. We will continue adding businesses as fast as ONYX grows.
  • ONYX Gift Cards do not expire
  • Cards are valued at convinient amounts to meet every need and occasion

The short answer

You don't generate test card numbers. Your payment processor already did, and the ones they publish are the only ones that behave the way you need. Stripe, Adyen, and Braintree each ship a fixed list of sandbox numbers where a specific digit pattern triggers a specific response: approval, decline, insufficient funds, expired card, CVC mismatch, processing error. A number you invent will pass the Luhn check and then do nothing useful, because the gateway has no rule attached to it.

If your goal is a working checkout test, pull the published numbers for your processor and move on. If you're after something else, keep reading, because the answer changes.

Why homemade numbers fall flat

Gateways in test mode don't check whether a card exists. They pattern match. Stripe sees 4000000000009995 and returns insufficient_funds. It sees a random Luhn-valid 16 digit string and returns a generic result, which tells you nothing about whether your error handling actually works.

That's the whole point. Test numbers are a control panel, not a randomizer. When I'm building an error state, I want to know exactly which input produces it, every single run.

What "generating" really means

The only genuine generation step is the Luhn algorithm, also called the mod 10 check. Take the digits, double every second one from the right, subtract 9 from anything above 9, sum it all, and the total has to end in zero. That checksum is baked into every card number ever issued. It catches typos. That's it.

A number that passes Luhn is not a valid card. It's a number that is formatted correctly. That gap matters, and it's where people wander into trouble. Using a self-generated number against a live gateway is card testing, it's fraud, and processors spot it within a handful of attempts. None of what follows works for that, and none of it is meant to.

Test numbers worth memorizing

These are Stripe's, and most other processors publish a near-identical set:

Any future expiry date works. Any three digit CVC works, or four digits for Amex. The 0127 card is the exception: it only fails when you feed it the wrong CVC, so it doubles as a positive test too.

Build a fixture file, not a generator

The practical move is to hardcode these into a constants file in your repo, keyed by scenario name. I want to read DECLINE_INSUFFICIENT_FUNDS in a test, not a magic number, and I want one place to update when a processor retires a card. Named fixtures also survive a code review, which a helper function that spits out random digits will not.

If you need volume, for load testing or seeding a local database, write a small utility that produces Luhn-valid strings. Keep it sandbox only. A generated number that reaches a live endpoint is either a failed charge or a fraud flag on your merchant account, and I've watched the second one take a week to unwind.

Things that trip people up

Checklist

  1. Find your processor's published test card list.
  2. Map each number to the failure state you need to handle.
  3. Store them as named constants in a fixture file.
  4. Assert on the error code, not just on the failure.
  5. Confirm you're on sandbox keys before anything runs.

Contact Us

Latest

Cannot write this content

I can't produce SEO content for a site whose purpose is selling CVVs, including a test card generator guide.

Latest

CVV Validation

Learn everything you need to know about CVV validation and why it's crucial for online shopping security.

CVV Checker

Discover how to use a CVV checker effectively for secure online purchases.

Read our complete guide: Should You Buy CVV From a Card Shop? The Honest Buyer's Guide