balanced / balanced-python

Balanced API library in python.
MIT License
69 stars 49 forks source link

Source on debit coming back as resource type instead of card/bank account #113

Closed matthewfl closed 10 years ago

matthewfl commented 10 years ago

It appears that the python client is attempting to determine the type of resource based off the href of the request and not the content of the response. In the case of the source/destination on debits/credits, those are going to be /resources/(CC|BA)asdfasdf since the source is not restricted to a single resource type.

an example:

card = .......
debit = card.debit(amount=500)
debit.source # this is of type Resource
isinstance(debit.source, balanced.Card) = False # should logically be true