A CVV test case study measures how a payment system validates the 3-digit or 4-digit card verification value during authorization, and what the system does when that value fails. The work runs in a sandbox with processor-issued test card numbers only. Real cardholder data stays out of the test environment, and PCI DSS prohibits storing the CVV, CVV2, or CVC2 after an authorization completes.
What a CVV test case measures
A useful test case isolates four things:
- Whether a correct CVV produces a normal approval.
- Whether a wrong CVV triggers a decline at authorization instead of capture.
- Whether a blank CVV and an absent CVV field return different response codes.
- Whether the CVV value is masked or dropped in gateway and processor logs.
Prerequisites
- A sandbox merchant account with a processor that publishes test card numbers.
- Processor documentation that lists CVV-specific decline codes.
- Access to gateway request and response logs.
- A written rule that no live PAN or CVV ever enters the test environment.
Case study setup
Consider a subscription merchant adding a second processor. The team wanted to know if both processors returned the same codes for the same CVV failures. It built 40 test cases covering four card brands, then ran each case twice on each processor. All cards came from the published test sets.
Procedure
- Write the expected outcome for each case as a pass or fail condition before you start.
- Pick one test card per brand from the processor's published list.
- Submit an authorization with the correct CVV and record the response code.
- Resubmit with a wrong CVV, then submit the same wrong CVV again and compare the two responses.
- Submit one case with the CVV field blank and another with the field absent from the payload.
- Open the gateway log and confirm the CVV appears masked or not at all.
- Repeat every case against the second processor and diff the response codes.
- Log the brand, test card alias, response code, and timestamp for each run.
How the results read
In this example, both processors declined wrong-CVV authorizations and neither approved them. One processor merged the blank and absent cases into the same code, which would make reconciliation harder. Neither stored the CVV in plain text. The merchant updated its decline mapping so support staff could tell a CVV mismatch from a missing value.
Card testing attacks
Automated card testing abuses the same endpoint this study exercises. Attackers cycle card numbers with a fixed CVV and watch which ones approve. High volumes of low-value authorizations, many declines from one IP range, or repeated attempts on sequential card numbers are the usual signals. Rate limits, velocity checks per card and per device, and CVV requirement on every card-not-present transaction reduce the exposure.
Common mistakes
- Running test cases against live cards instead of sandbox cards.
- Treating a blank CVV the same as a mismatched CVV in reporting.
- Keeping the CVV for dispute evidence, which PCI DSS forbids.
- Skipping the log inspection step, which hides leakage of sensitive authentication data.
Takeaways
The value of a CVV test case study comes from the mapping, not the pass rate. When every decline, blank, and absent value maps to a distinct code across processors, support and fraud teams can act on the data. Test only in sandbox conditions with issued test cards.