#makasmi-webhook-json
1 messages ยท Page 1 of 1 (latest)
Hello ๐
Give me a moment to look into this and I'll respond as soon as I can ๐ Thanks
How exactly are you integrating Stripe? Are you using Stripe Checkout?
What events are you listening to?
thanks , ok
I also want to know the event to listen to invoice.payment_succeeded or checkout.session.completed
I want an event that is specific for recurring payments and that gives the payment id, amount and customer info
i was listening checkout.session.completed but i think for recurring payment i must listen invoice.payment_succeeded ?
for your first question : https://checkout.stripe.com/pay....
yes
checkout.session.completed delivers a checkout session object
https://stripe.com/docs/api/events/types#event_types-checkout.session.completed
so yeah, as you mentioned earlier, you can check the mode property to see if its related to one-time payments or subscriptions
https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-mode
You can check the PaymentIntent information on the Checkout Session object by retrieving the session using the ID and expanding payment intent
https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-payment_intent
https://stripe.com/docs/api/expanding_objects
Great but i inspect the 2nd payment and i did'nt receive a chekout.session.completed
in fact during the first registration for a subscription of a recurring payment I manage to save it in the database, on the other hand I also want to save in the database the next automatic payments
in the second automatic payment i only received invoice.payment_succeeded
ah okay, so to track recurring payment on an invoice you should listen to invoice.paid event
We have some great docs on Subscription webhook events here
https://stripe.com/docs/billing/subscriptions/webhooks#events