Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

seongbae's avatar

How to test bad credit card when purchasing new subscription

HI,

On our website, users create payment methods using credit card. Once payment method has been added, they can purchase subscription.

Recently, we've had a few instances where users had their credit card lost/stolen and their card is no longer valid. Then they try to purchase a new subscription with the same card (because it was added when the card was in good status). Then it errors out because Stripe does not let the user create subscription with bad credit card.

I want to be able to test creating new subscription with bad credit cards but Stripe will not let me add them in the first place so I cannot test it.

Did anyone run into similar issue?

Thank you.

0 likes
3 replies
seongbae's avatar

tykus, thanks. I'm aware of test credit cards on that page. But I cannot add cards with bad numbers in the first place so I can't test purchasing new subscription.

seongbae's avatar

@tykus Nevermind. I was able to find one that can be added and then fail when I try to make a new subscription. Thank you!

Please or to participate in this conversation.