#liodegar-webhook-events-enquiry
1 messages · Page 1 of 1 (latest)
payment_intent.succeeded is specific to a payment made successfully via a PaymentIntent, where invoice.payment_succeeded is the payment for the specific invoice had been successful.
The normal flow of charging for a subscription [0]:
- An invoice is created
- A PaymentIntent is created
- The customer pays.
In this normal flow, both of these webhook events are generated.
There are exceptions such as trials and setting up the subscription for a future start date where instead of PaymentIntent, a SetupIntent is used.
My recommendation is to listen to the invoice.payment_succeeded event if you would like to keep the customer subscription active in your backend system.
There is also the invoice.payment_failed event to provide failed payments that you might be interested.
Hope you find this useful
[0] https://stripe.com/docs/billing/subscriptions/overview#subscription-objects
Same to you, have fun coding!