A CVV test for PCI DSS is the process of confirming that your payment integration checks the card verification value correctly, using issuer-provided test card numbers in a sandbox environment instead of live cardholder data. Because PCI DSS forbids retaining the CVV after authorization, the test must prove two things at once: that your system validates the code, and that it never stores or logs it. Done properly, the test produces evidence your QSA or assessor can review without exposing sensitive authentication data.
What a CVV test for PCI DSS actually checks
The goal is not to confirm that a card is valid. It is to confirm that your payment flow behaves correctly at each possible response from the issuer. A complete test covers:
- Successful authorization with a matching CVV result code.
- A CVV mismatch response, and how your checkout handles it.
- A missing or unreadable CVV response from the issuer.
- Confirmation that the CVV value does not appear in logs, database tables, queue messages, or error traces after the transaction completes.
That last item is where many integrations fail. The functional test passes, but the value lingers in an application log or a support ticket export.
Which PCI DSS requirements apply to CVV handling
PCI DSS treats the CVV, CVV2, CVC2, and CAV2 as sensitive authentication data. The standard prohibits storing this data after authorization, even when encrypted, and places limits on how the full primary account number is displayed. Several requirement areas come into play during a CVV test:
- Data retention: sensitive authentication data must not be kept post-authorization.
- Encryption in transit: the CVV must be protected with strong cryptography when transmitted over open networks.
- Logging and monitoring: audit trails must not capture sensitive authentication data.
- Development and testing: test data and test accounts must not use live production data.
Review the current PCI DSS version your acquirer references, since requirement numbering shifts between versions even when the intent stays the same.
How to run a CVV test in a sandbox
- Collect the published test card numbers for your processor. Each brand and processor distributes its own set, including PAN and CVV combinations that trigger specific response codes.
- Build a test matrix: matching CVV, mismatched CVV, no CVV supplied, and a card type that does not use a CVV.
- Run each case through the same checkout path a real customer uses, including any retry or saved-card logic.
- Capture the gateway response code for every case and confirm your front end shows a sensible message without revealing the CVV outcome to an unauthenticated party.
- Search logs, database dumps, cache layers, and third-party error trackers for the test CVV values. A hit means remediation is required.
- Record the test date, environment, card numbers used, and the results as assessment evidence.
Reading the results: approved, declined, and CVV mismatch
Issuers return distinct codes for a CVV failure versus a general decline, and your application should treat them differently. A CVV mismatch typically means "do not honor, retry allowed" rather than "stolen card." Decide in advance whether your business rules retry the transaction, prompt the customer to re-enter the code, or simply surface a generic error. Document that decision, because an assessor will ask why the flow behaves as it does.
Common mistakes that turn a test into a compliance finding
- Testing with a real card, even the tester's own, in a non-production environment.
- Logging the full request payload at debug level and leaving that setting enabled in production.
- Storing the CVV "temporarily" in a session table to support a retry flow.
- Masking the PAN on screen but including the CVV in a customer support email template.
- Assuming a tokenized vault removes the obligation to verify that no raw value reaches your own systems.
Evidence to keep for your assessment
Assessors want reproducible proof, not a verbal confirmation. Keep the test plan, the matrix of cases, the recorded responses, and the log search output showing zero matches for the test CVV values. Pair that with a configuration screenshot proving debug logging is disabled in production. Together these documents answer the question an assessor will actually ask: how do you know the value is not retained?