#barba - customer subscription renewal

1 messages · Page 1 of 1 (latest)

loud laurel
#

Under normal renewal circumstances, the latest invoice and current period would change on the subscription, but what are you really trying to do?

hybrid fossil
#

just listening the subscription updated to track some information/notifications and I need to differentiate when the updated subscription webhook happened because an automatic renew

#

so far as you mention I'll get in the previous_attributes object two fields

  • latest_invoice
  • current_period_end
    isnt it?
hybrid fossil
#

?

loud laurel
#

yes, assuming no other changes

#

But you may was to listen to invoice.paid for renewals instead, depend on what you're trying to do

hybrid fossil
#

mmmm well I have to double check if the invoice.paid has all the info I need:

  • id
  • plan id
  • plan amount
  • plan currency
  • current_period_end
#

in case the invoice has all this I could use it in other case I have to keep using the subscription.updated

loud laurel
#

It would have the amounts for the invoice lines, yes, but eg there may be discounts applied

hybrid fossil
#

good point.. then im not interested I think I'll go with the subscription event 😦

loud laurel
#

Up to you! You can also use expansion to pull in the full price objects, for example, but you should do what works for your app!

hybrid fossil
#

its ok now you have confirmed me the two fields I will get at the susbcription updated when we renew

#

Im not sure how to test it from the stripe/test UI , any tip? thanks

loud laurel
#

What do you mean? What exactly do you want to test?

#

If you mean a subscription renewal, you should set up some subscriptions in test mode

#

These will fire off events to your test mode webhook endpoint

hybrid fossil
#

yep I mean that, so I'll create a subscription in test mode (I know how to do this) and activate it. now with the susbcription created I need to simulate a renew subscription to test the webhook