#blindChicken
1 messages · Page 1 of 1 (latest)
You would have to explicitly update the Charge object to add in metadata to it. Why not listen for the invoice.paid event instead?
It makes no difference to me really which event I listen for, provided that I get notification that the customer's payment succeeded and that I can map that back to the exact check out session.
You should really just use the checkout.session.succeeded event then. Why are you listening for other events if you just want to get to the Checkout Session?
I'm new to using Stripe, so it's mostly ignorance, but I was under the impression that these event were distinct, and that it was possible to get checkout.session.succeeded but then the payment fails or something, and instead of getting charge.success I'd get charge.failed instead.
checkout.session.completed is once the Checkout flow is done, the invoice payment events are separate from that, so it depends what you want to track
For right now, I need to know with certainty that the user has completed the checkout and payment has gone through. At some other point, (when I finished building the checkout flow on my app) I will then need to worry receipt of subsequent (monthly payments).
If you want to do that, when you get the checkout.session.completed you can retrieve the subscription and expand the latest_invoice property to check that the first invoice was paid
Using expand=['lastest_invoice']
https://stripe.com/docs/expand