Answer

A card number generator test creates a card number that passes the Luhn check. The number is for a sandbox payment form. It is not a real card account. It cannot approve a charge.

Test numbers come from payment processor docs. They work in test mode with a test API key. They fail on a live checkout page.

What the Luhn check does

The Luhn algorithm is a checksum. It catches one-digit typos and most swapped digits. It does not prove a card exists. It does not check the expiry date, the CVV, or the billing address.

A generator can make a number that passes Luhn. That number still fails at the issuer. Payment processors reject it outside test mode.

Where test numbers come from

Payment processors publish test card numbers in developer docs. Stripe lists 4242 4242 4242 4242 as a Visa test card. Adyen and Braintree publish similar lists. These numbers work in sandbox mode with a test API key.

  • Stripe: test cards for Visa, Mastercard, and error cases.
  • Adyen: test cards for each result code.
  • Braintree: test numbers for decline and success paths.

How to test a payment form

  1. Use a sandbox account from the processor.
  2. Enter a test PAN from the processor docs.
  3. Use a future expiry date and a 3-digit CVV in test mode.
  4. Check the response code. Test cards can trigger declines on purpose.

Do not use a live API key. Do not use a real card number in a test.

Limits and legal notes

Test numbers do not carry funds. They do not pass 3-D Secure. They do not work on production checkout pages.

In the US, 18 U.S.C. ยง 1029 covers access device fraud. Using a card number without authorization can lead to criminal charges. PCI DSS requires that test environments use non-real card data.

Common errors

  • A number that passes Luhn but fails the BIN check.
  • A test card used with a live key.
  • A CVV field that rejects test values.