#Shiroyasha
1 messages · Page 1 of 1 (latest)
hi! do you have an example of such a partial refund I can look at and where(which object exactly) you want to see metadata added?
Through the event "charge.refunded"
I have a web hook on it
I see all refund
But thing is I only want to deal with partial refund made through my dashboard. Not all the refund
there's unfortunately no good way to do that(differentiate if an event was generated from an API call you made, or from a Dashboard action), it's a common ask
Ah ok
you could make it so that when you issue a refund from your own code, you update the Charge with metadata first to indicate "I have refunded this", and then it will be returned in the webhook event, or you could save that context of "charge IDs I explicitly refunded" to the database of your app and check that in the webhook handler. Not great options I know
Thing is that the refund is not emitted by my code
The refund I want to grab is a refund made by an other member of my team who is working only through dashboard
How can my code update the charge with metadata then?
well I mean the opposite
like, when you create a refund in your own code, you can add metadata
if that metadata is then not present in an event, it means it was probably the dashboard
Ah ok I got it
ultimately it's hacky and error-prone, there's just not a good answer
Not the best way but maybe we can do that
for completeness, https://stripe.com/docs/api/events/object#event_object-request exists to indicate if an event was generated by a request. But the dashboard makes requests too, and you can't tell if that request was from your code or from the dashboard, hence the problem