Stripe Payment Intent Failing
Quick Answer
Common causes: using test cards in live mode, wrong currency units, or missing return_url for 3D Secure. Start with "Check common causes" before making broader code changes.
You're in the right place if...
- !Payment form shows error
- !Card declined in test mode
- !Payment intent returns error status
Why this happens
Common causes: using test cards in live mode, wrong currency units, or missing return_url for 3D Secure.
Fix
Check common causes
Match your error:
// 1. Using test card in live mode
// Fix: Use 4242 4242 4242 4242 in TEST mode only
// 2. Currency mismatch — amounts in smallest unit
amount: 2000, // = $20.00 (cents for USD)
currency: 'usd',
// 3. Missing return_url for 3D Secure cards
return_url: `${process.env.NEXT_PUBLIC_URL}/payment-complete`Prevent this next time
Always test with Stripe's test card numbers. Amount is always in the smallest currency unit (cents for USD, pence for GBP).
Frequently Asked Questions
Stripe uses the smallest currency unit. $20.00 USD = 2000 cents. €15.50 EUR = 1550 cents.
4242 4242 4242 4242 for success. 4000 0000 0000 9995 for decline. Any future expiry and 3-digit CVC.
Related fixes
Weekly Newsletter
Get next week's fix before you need it.
Join developers getting weekly vibe coding tips, error fixes, and tool updates.
Subscribe on Substack →