#Himel

1 messages · Page 1 of 1 (latest)

somber krakenBOT
hoary bear
#

I am looking for a way to test my subscription implementation. Let's say I have a subscription where the first payment went smoothly, but later on, there might be issues such as insufficient funds on the card or other problems that could cause payment failures. Now, how can I simulate this scenario for testing my subscription? Even if I try something like "stripe trigger invoice.payment_failed," that event doesn't involve an actual subscription. So, I'm having trouble understanding how to perform the test.

#

👋 happy to help

#

you can use test clocks

fluid igloo
#

but with test clock how can i simulate failed payment with subscription i ddint find a single articale about it

hoary bear
#

with test clocks you can advance in time to the next billing cycle

fluid igloo
#

i did manage to go through time to see my subscription but how can make failed! and that trigger my webhook so can be sure that user is getting notified in frontend

hoary bear
#

after the first invoice

#

you can attach this card (Decline after attaching) https://stripe.com/docs/testing#declined-payments to your customer and set it as the invoice_settings.default_payment_method

Use test cards to validate your Stripe integration without moving real money. Test a variety of international scenarios, including successful and declined payments, card errors, disputes, and bank authentication. You can also test non-card payment methods.