#blackbirdgunner
1 messages · Page 1 of 1 (latest)
Hi! Let me help you with this.
I would recommend listening to invoice.paid or customer.subscription.created/updated
will customer.subscription.updated be fired if user upgrades/downgrades their plan? If so, is there a way to identify if the event was fired for renewals or subscription changes like plan upgrade/downgrade?
You can check what fields were updated in data.previous_attributes: https://stripe.com/docs/api/events/object#event_object-data-previous_attributes
But that's why I would recommend invoice.paid more
so should I be using invoice.payment_failed for taking action on payment failure, instead of the payment_intent one?
or is there a more suitable event?
Yes, invoice.payment_failed is fine. Note, there might be several retry attempts, each producing this event.
there might be several retry attempts
Is this due to user retrying and failing again or stripe retrying same payment automatically?