#aosbornee
1 messages · Page 1 of 1 (latest)
hi! well there are multiple events. customer.subscription.updated and also invoice.paid or invoice.payment_failed, depending on what happens with that payment attempt that occurs at the end of the trial.
so when that sub.updated triggers, how do I know it came from a trial ending
is there an attribute within the event I can look out for?
previous_attributes[status] would be trialing showing that it was on trial and has now moved to a different status
gotchaaa, appreciate that man
and when a user of mine's payment fails, how can I handle this?
there's an invoice.paid webhook event you can listen to to detect when that happens
on the trialSettings I see we can set an end behaviour, which pauses the subscription like such
trial_settings: {
end_behavior: {
missing_payment_method: 'pause',
},
},
is there a way to do this when an invoice fails, to pause the sub?
if you mean for just any other future invoice on the subscription, I don't think so, I think this param is just specifically for trials
if a regular recurring invoice fails it uses the settings you have in your dashboard (https://dashboard.stripe.com/settings/billing/automatic ) for retries etc
after a certain number of retries fails, what happens?
depends on your settings
don't think so