#atilla.fib
1 messages ยท Page 1 of 1 (latest)
Hello, unpaid is a status that your subscriptions can go in to based on your settings for handling failed payments
https://dashboard.stripe.com/settings/billing/automatic
We talk more about that status in this doc
https://stripe.com/docs/billing/subscriptions/overview#unpaid-subscriptions
docs dont help with my use case
you can close this unless anyone has an idea on how to simulate unpaid in test env
๐ stepping in as Pompey needs to step away
As noted above it is based on failed payments, so you basically want to trigger the necessary amount of failed payments using the 4000000000000341 test card (which declines after attachment)
can you give step by step ?
- have an active sub
- attach the card to the subscription
- reset billing to now? but this will get into overdue status
if i reset billing anchor to now while unpaid, will it work same as overdue?
overdue will just get new invoice and attempt charge
No you don't want to reset the billing anchor, you want to set your settings to set the Sub unpaid after retries and then you can use a test clock (https://stripe.com/docs/billing/testing/test-clocks) to advance time to trigger those retries
hmm, give me half hour to test this and will be back with an update
While I look, why do you want this anyway?
Like if it is just for testing then you should just mock the status response...
i have an endpoit for customers to retry the payment
i want to test it for unpaid sub
for overude its working
stripe.Subscription.modify(
sub.get("id"),
payment_behavior="error_if_incomplete",
off_session=True,
proration_behavior="none",
billing_cycle_anchor="now",
)
this is what i do for overdue
so i want to reset the billing start date and try to charge again also for unpaid
will it work? i want to test it
You didn't adjust your setting at https://dashboard-admin.stripe.com/settings/billing/automatic
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
If you want a Subscription to move to unpaid then you have to change the If all retries for a payment fail,
setting
Otherwise your Subs will never be "unpaid", they will just cancel
ok now i understand
in prod we have unpaid so the account from test had diff settings
Gotcha