#A2023
1 messages · Page 1 of 1 (latest)
Hi there!
You should use Test Clocks for this: https://stripe.com/docs/billing/testing/test-clocks
I created a test subscription and added a card which will expire soon but using the test clock, I advanced the time and the payment succeeded and I don't know, how.
You'll need to change the card attached to the customer to a card that will fail.
You can learn more about this here: https://stripe.com/docs/billing/testing#payment-failures
I need to change the card?
What card number?
The defective credit cards do not even allow payments at stripe checkout page.
Okay, so taking a step back, you have two main option to achieve what you want.
The simplest option: add a short free trial to your subscription (like 1 minute), and use a test card that will fail (like 4000 0000 0000 0341 mentioned in the link above). When the free trial ends, Stripe will try to charge the card, and it will fail.
The other option: start a regular subscription with a valid test card. Then update the default payment method of the customer to the card 4000 0000 0000 0341, then advance the test clock, and the next payment will fail.
oh okay thank you for the detailed explanation
