balanced / balanced-api

Balanced API specification.
220 stars 72 forks source link

Use holds for search/ and transactions/ endpoints #629

Closed kyungmin closed 10 years ago

kyungmin commented 10 years ago

Not having consistent naming scheme is causing errors on the dashboard.

/transaction expects card_hold:

https://api.balancedpayments.com/transactions?limit=50&offset=0&q=&sort=created_at%2Cdesc&status%5Bin%5D=failed%2Csucceeded%2Cpending&type%5Bin%5D=debit%2Ccredit%2Ccard_hold%2Crefund

> "Field \"type\" value \"hold\" is not one of \"credit\",\"debit\",\"card_hold\",\"refund\"

however,

/search expects hold:

https://api.balancedpayments.com/marketplaces/TEST-MP7C7Ie18Da0FKtejkFB9xsC/search?limit=50&offset=0&q=&sort=created_at%2Cdesc&status%5Bin%5D=failed%2Csucceeded%2Cpending&type%5Bin%5D=debit%2Ccredit%2Chold%2Crefund

> "Field \"type\" value \"card_hold\" is not one of \"credit\",\"debit\",\"hold\",\"refund\"

We should use holds instead of card_holds throughout Balanced API.

mjallday commented 10 years ago

We should use card_holds instead of holds throughout revision 1.1 of the Balanced API

kyungmin commented 10 years ago

@mjallday Can you explain why card_holds is a better name for this?

remear commented 10 years ago

The resource name is CardHold and you can only do a hold (authorization) on a Card, not on, say, a BankAccount.

kyungmin commented 10 years ago

I don't feel too strongly about either option, but I'm curious why we switched from holds to card_holds, since holds sounds totally fine to me. Generalizing the name would allow us to keep the name the same if we ever want to allow holds on other funding instruments.

kyungmin commented 10 years ago

Hm, both search/ and transactions/ are expecting card_hold now. Has it been fixed?

mjallday commented 10 years ago

no, i suspect you passed through something that caused it to be processed as a revision 1.0 request e.g. adding /v1 to the start of the url. i'm going to close this issue, it doesn't sound like there is a problem