#aosbornee

1 messages · Page 1 of 1 (latest)

nimble basaltBOT
steady sable
#

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.

ebon pier
#

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?

steady sable
#

previous_attributes[status] would be trialing showing that it was on trial and has now moved to a different status

ebon pier
#

gotchaaa, appreciate that man

#

and when a user of mine's payment fails, how can I handle this?

steady sable
#

there's an invoice.paid webhook event you can listen to to detect when that happens

ebon pier
#

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?

steady sable
#

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

ebon pier
#

after a certain number of retries fails, what happens?

steady sable
#

depends on your settings

ebon pier
#

ahhh

#

there's no option to pause?

steady sable
#

don't think so

ebon pier
#

gotcha, cancel should still be okay

#

thanks my man