#liodegar-webhook-events-enquiry

1 messages · Page 1 of 1 (latest)

obtuse ingot
#

Hi there,

obtuse ingot
#

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]:

  1. An invoice is created
  2. A PaymentIntent is created
  3. 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

Learn how subscriptions work within Stripe.

eternal wedge
#

Yes, this explanation is quite useful. Thank you very much

#

Have a nice day

obtuse ingot
#

Same to you, have fun coding!