balanced / balanced-php

Balanced API library in php.
MIT License
71 stars 37 forks source link

PHP error with $buyer->debit #12

Open oppenheimer opened 11 years ago

oppenheimer commented 11 years ago

When trying to charge a card using $buyer->debit, if you pass the card URI instead of the account URI an error is generated instead of an exception.

bninja commented 11 years ago

@oppenheimer do you mean this func: https://github.com/balanced/balanced-php/blob/master/src/Balanced/Account.php#L92 ? that doesnt take an account.

oppenheimer commented 11 years ago

Andrew

If I do

$buyer = Balanced\Account::get($uri);

with the $uri = to the credit card, it does not generate an exception. Then if I do

$buyer->debit(5000);

I get an error and not an exception.

Instead for the first statement, I should have used the URI = to the account.

Gordon

On Sun, Dec 16, 2012 at 2:47 PM, andrew notifications@github.com wrote:

@oppenheimer https://github.com/oppenheimer do you mean this func: https://github.com/balanced/balanced-php/blob/master/src/Balanced/Account.php#L92? that doesnt take an account.

— Reply to this email directly or view it on GitHubhttps://github.com/balanced/balanced-php/issues/12#issuecomment-11421890.

bninja commented 11 years ago

@oppenheimer thanks for the clarification, will investigate detecting that in get