#rohithsai-payments
1 messages · Page 1 of 1 (latest)
@last sky hi! do you have an example of an event ID evt_xxx where you don't see the metadata?
@last sky so that event is charge.refund.updated, which means it's a Refund object. The metadata is on the Charge object instead, and it doesn't copy automatically to the Refund
so you would need to retrieve the Charge object from the API and look at that
https://stripe.com/docs/api/refunds/object#refund_object-charge
or you could retrieve the Refund and "expand" the charge field https://stripe.com/docs/expand/
@vivid elbow we are getting metadata in charge.refund why we are not getting in charge.refund.updated?
because it will avoid us making one more call just to get metadata
the charge.refunded event contains a Charge object, while charge.refund.updated contains a Refund object (seehttps://stripe.com/docs/api/events/types#event_types-charge.refund.updated )
the reason it works this way is you might want to have different metadata on a charge versus a refund
so they have different metadata across the different objects
if you see this 4000000000005126 scenario in stripe doc
Charge succeeds but refunding a captured charge fails asynchronously with a failure_reason of expired_or_canceled_card. Note that because refund failures are asynchronous, the refund will appear to be successful at first and will only have the failed status on subsequent fetches. We also notify you of refund failures using the charge.refund.updated webhook event.
I think in this scenario both charge.refunded and charge.refunded.updated are from the same metadata is it possible to add metadata in these type of scenario
@vivid elbow