#dariodjuric

1 messages · Page 1 of 1 (latest)

slate yewBOT
turbid spindle
#

Yep, should do. Easy enough to test!

glass venture
#

Thanks. I did not see it being triggered, though. I'll keep troubleshooting.

turbid spindle
#

Can you share the pi_xx ID you're trying to refund?

glass venture
#

Sure, here it is: pi_3OMadcF2MCQECb2m14z1Uop7

turbid spindle
#

refund.created is specific to customer cash balance (bank transfers)

glass venture
#

Right. I actually tried to use charge.refunded initially, but I don't see the exact amount refunded. The charge.amountRefunded field only contains the total amount refunded for that charge.

turbid spindle
#

Yeah there's no field for the specific amount refunded on that refund. What you could do is leverage the previous_attributes hash and calculate the refund amount using amount_refunded there

#

i.e. amount_refunded - previous_attributes[amount_refunded]

#

Will give you the net refund amount for that specific event

glass venture
#

That comes as a webhook event attribute? Thanks, interesting approach.