#Shiroyasha

1 messages · Page 1 of 1 (latest)

vivid garnetBOT
normal ruin
#

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?

wintry kindle
#

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

normal ruin
#

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

wintry kindle
#

Ah ok

normal ruin
#

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

wintry kindle
#

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?

normal ruin
#

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

wintry kindle
#

Ah ok I got it

normal ruin
#

ultimately it's hacky and error-prone, there's just not a good answer

wintry kindle
#

Not the best way but maybe we can do that

normal ruin
wintry kindle
#

OK. Good to know

#

Thanks for your help!

#

Have a nice day