invalid_cvc HTTP 402 Stripe Declines

Stripe Error: invalid_cvc –

When the Stripe API encounters an invalid CVC number during a payment processing attempt, it triggers this error. This occurs when the cardholder's verification value (CVC) does not match the one stored in the system or is otherwise incorrect. It does NOT mean that the card itself is invalid or that there are insufficient funds.

Official documentation ↗

Root Causes

1.

Incorrect CVC number

The CVC number entered during payment processing does not match the one stored in the system.

2.

CVC number not provided

The CVC number was not supplied or is missing from the payment information.

Resolution

1.Verify CVC number

Ensure that the CVC number entered during payment processing matches the one stored in the system.

2.Check for missing CVC information

Review the payment information to ensure that the CVC number is included and correctly formatted.

Code Examples


            stripe.api_key = 'YOUR_STRIPE_API_KEY'
try:
	charge = stripe.Charge.create(amount=1000, currency='usd', source='tok_visa')
except stripe.error.CardError as e:
	print(e.user_message)
          

            const stripe = require('stripe')('YOUR_STRIPE_API_KEY');
try {
	charge = await stripe.charges.create({amount: 1000, currency: 'usd', source: 'tok_visa'});
} catch (err) {
	console.log(err.raw.message);
          

            $stripe = new Stripe('YOUR_STRIPE_API_KEY');
try {
	$charge = $stripe->charges->create(['amount' => 1000, 'currency' => 'usd', 'source' => 'tok_visa']);
} catch (Stripe\CardError $e) {
	print($e->getMessage());
          

            -X POST -H "Authorization: Bearer YOUR_STRIPE_API_KEY" https://api.stripe.com/v1/charges -d "amount=1000&currency=usd&source=tok_visa"
          

FAQ

Why is my Stripe payment failing with an invalid CVC error?

This error occurs when the CVC number entered during payment processing does not match the one stored in the system. Ensure that the CVC number is correct and included in the payment information.

How do I prevent this error from occurring in my Stripe payments?

Verify that the CVC number is correctly formatted and included in the payment information.

Independent reference. Always verify against the official Stripe Declines documentation.