CVV 3-Digit Test: Validate and Test the Card Security Code

What a CVV 3-digit test checks

A CVV 3-digit test confirms that your checkout form accepts exactly three digits in the card security code field for Visa, Mastercard, and Discover, and exactly four for American Express. The test passes only when the field rejects letters, symbols, spaces, and wrong-length input, and when the entered value is dropped after the authorization response instead of being written to a database or log.

The security code goes by several names. Visa calls it CVV2, Mastercard calls it CVC2, and American Express calls it the Card Identification Number. All of them live on the card itself, which is what makes the field worth testing.

Prerequisites

How to run the test

  1. Open the sandbox checkout page and load a test card number into the card field.
  2. Type three digits into the security code field and submit the form.
  3. Confirm the transaction authorizes and the response returns an approval code.
  4. Reload the page and enter two digits in the same field.
  5. Confirm the form blocks submission and shows a length error.
  6. Enter five digits and confirm the form blocks submission again.
  7. Paste 12 3 with a space and confirm the field rejects the space or strips it.
  8. Paste abc and confirm the field rejects non-numeric characters.
  9. Load an American Express test card and confirm the field now accepts four digits and rejects three.
  10. Search your application logs, database dumps, and error tracker for the value you typed.
  11. Confirm the value appears nowhere outside the authorization request.

Common failures

Sandbox behavior

Most processors accept any three-digit code on their published test cards, and some accept any four-digit code on the American Express equivalents. That means a passing sandbox test proves your form handles the input correctly. It does not prove the code is valid on a live card, because only the issuing bank can answer that.

Handling rules that matter

Payment card industry rules bar merchants from storing the security code after authorization, in any form, encrypted or not. Your test should end by confirming the value is gone. If your architecture needs the code again for a later charge, the customer has to re-enter it. Build the retry flow around that constraint instead of caching the value.

More

Read our complete guide: Buy CVV Cheap: Pricing, Risks, and What First-Time Buyers Need to Know