#surgical
1 messages · Page 1 of 1 (latest)
👋
The only way you would see the charge object in your listener is if you retrieve the PaymentIntent ID and expand latest_charge: https://stripe.com/docs/api/payment_intents/object#payment_intent_object-latest_charge
we're not retrieving any intent, as we're just getting the event object from the webhook - in our test account, we do receive an object of charges:
Ohhhhh
I'd recommend updating your code to handle latest_charge instead (latest_charge is on older API versions as well)
okay got it. so if we receive the intent succeeded through webhook and there is no charges object, should we just make a call to get the same intent id, ie intents.retrieve, and request for the latest charge?
I would just always retrieve the PaymentIntent in the handler and expand latest_charge
Unless you care about the non-successful charges?
But either way you are going to need to do that for the newer API versions so you should just update your code for the handlers that are on an older API version as well.