Closed aimee-ault closed 10 years ago
@aimee-ault Balanced does not know what to refund if you don't provide the debit.
The reason the debit uri is optional is because it can be implicit in the URL e.g. /debits/WD12312312/refunds
already has the debit in the prefix of the string so it doesn't need to be explicitly passed.
Using the ruby client you can do this one of two ways:
Balanced::Debit.find('/debits/WD123123').refund(amount)
Balanced::Refund.new(:debit_uri => '/debits/WD123123').save
The second one requires you to know the debit but you do not need to fetch it first.
Ah, that's fair. Thanks for answering!
The API documentation indicates that the debit URI is an optional value (https://docs.balancedpayments.com/current/api#issue-a-refund), however the only way using this library to initiate a refund is using a Debit object fetched by debit URI. There should be a method on the Customer object that also allows you to initiate a refund.