A CVV test response code is the value a payment gateway returns when you submit a test card's card verification value in a sandbox environment. Codes such as M, N, S, U, and P tell you whether the code matched, failed verification, could not be checked, or was not processed, so you can confirm your integration handles each case correctly.

cvv test response code list

What the common test CVV codes mean

Most gateways follow the same five-letter convention defined by the card networks and implemented in sandbox APIs. The letters describe the issuer's verification result, not the authorization outcome.

more on this topic

  • M (Match). The CVV supplied matches the value on file with the issuer. The transaction can proceed to authorization.
  • N (No match). The CVV is wrong. Gateways return this as a decline or a CVV failure flag.
  • S (Should have been present). The issuer indicates the card requires a CVV but the request did not include one, or the merchant marked it as not provided.
  • U (Unable to verify). The issuer or processor cannot check the CVV, because the card issuer does not participate in CVV verification or the data is unavailable.
  • P (Not processed). The CVV was not processed, because the transaction failed earlier in the flow, such as an expired card or a blocked merchant category.

Why test CVV codes matter in integration testing

Test response codes let you simulate every verification outcome without using real card data. You can route an M response to a successful checkout, an N response to a check-your-card-details message, and an S or U response to a fallback flow that asks for a different card or allows the order to continue with additional review.

cvv test response code declined

They also help you distinguish a CVV failure from an authorization failure. A gateway can return a CVV code of N while the authorization still returns an approval in some test configurations. Your code should read both fields separately rather than assuming one implies the other.

cvv test response code declined

How to read a CVV test response

In a sandbox response, look for the CVV result field in the gateway's response payload. It is often labeled cvvResultCode, card_code_response, or a similar name depending on the provider. Pair it with the authorization response code and the transaction status to get the full picture.

  1. Check the CVV result code first (M, N, S, U, P).
  2. Check the authorization response (approved, declined, error).
  3. Log both values separately so your support team can diagnose issues.
  4. Map each code to a user-facing message in your test matrix.

Common pitfalls

  • Treating U or P as a hard decline when the intended behavior is to continue or retry.
  • Assuming a CVV match means the transaction is approved.
  • Using production card numbers in a sandbox; always use the gateway's published test cards.
  • Storing CVV values after authorization; PCI rules prohibit retaining the code.

Test codes versus live verification

Test response codes are deterministic simulations. In live processing, the issuer decides the result and the gateway passes it back. The meaning of the letters stays the same, but the outcome depends on the card, the issuer, and the merchant's settings. Use test codes to build and validate your logic, then confirm live behavior with real low-value transactions under your provider's rules.