#developer - checkout
1 messages · Page 1 of 1 (latest)
I'm trying to create a checkout session for one time payment, how should I track which payment is made for this session? Usually I catch the event invoice.payment_succeeded when it's for subscription
Ah, for that I'd suggest checkout.session.completed and inspecting for mode=payment :
https://stripe.com/docs/payments/checkout/fulfill-orders#create-event-handler
And you can check for payment_status=paid:
https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-payment_status
To my understanding, at the time of session completed, payment status is not necessarily "succeeded"... is there another way?
That documentation covers the scenario of asynchronous payment methods
You'd listen for checkout.session.async_payment_succeeded, for example
thanks!
NP!
I went over the documentation and I understand that async payment is only for certain payment methods, so I don't get this event for regular credit card. My question now is, will payment_status=paid in checkout.session.completed mean that the funds went through and I can fulfill the order?
The async event is only for async payment method, correct. Yes you can consider the payment complete when the Checkout session has paid payment_status
Thanks again!
NP!