balanced / balanced-api

Balanced API specification.
221 stars 72 forks source link

Reverse a Transfer #507

Closed remear closed 9 years ago

remear commented 10 years ago

We need a way to reverse a Transfer. I was considering adding a reverse method to the Transfer classes in the client libraries that would debit the destination for the amount of the transfer (or I guess allow a partial amount reversal here) but this would fail if the bank account isn't verified. Another way might be to expose the Transfer's credit so you could call reverse on it.

@steveklabnik, can we discuss this and spec out the behavior.

jkwade commented 10 years ago

@remear I think any bank account that has been successfully credited should be able to be debited without verification.

steveklabnik commented 10 years ago

Wouldn't you just create another transfer in the opposite direction?

remear commented 10 years ago

Can you create a Transfer from a BankAccount to an Account?

steveklabnik commented 10 years ago

https://github.com/balanced/balanced-api/pull/506/files#diff-6d3afff639394402451004c942f07c27R1

mjallday commented 10 years ago

The issue that I foresee is that a transfer in the opposite direction isn't linked to the original transfer.

Transfers behave differently to regular transactions however so maybe this is not a use-case that needs to be covered. E.g. if you wanted to record the flow of funds then you use an order.

e.g. account -> debit -> order -> credit -> bank account -> reverse -> order -> refund -> account.

remear commented 10 years ago

This is also one of my concerns. Users generally like to have a definitive audit trail for the flow of funds.

mjallday commented 10 years ago

We provide that with transactions and orders.

steveklabnik commented 10 years ago

Makes sense, just trying to tease out all the requirements here.

remear commented 10 years ago

Should there be a reference between the original Transfer and the reverse Transfer?

Would adding a reverse method to Transfer make this any easier for customers?

steveklabnik commented 10 years ago

I'd imagine that it's be similar to refunds. A reference would be ideal, but not required?

msherry commented 10 years ago

All refunds do reference the original debit, fwiw. Same with credits and reversals. There should never be a naked refund or reversal.

steveklabnik commented 10 years ago

Seems good. I was thinking at the card network level, not the Balanced level.