Skip to content

Commit fde6c18

Browse files
author
Marshall Jones
committed
fix bank account debits example
1 parent 04613f6 commit fde6c18

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

balanced/exc.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@
66

77

88
class BalancedError(Exception):
9-
pass
9+
10+
def __str__(self):
11+
attrs = ', '.join([
12+
'{0}={1}'.format(k, repr(v))
13+
for k, v in self.__dict__.iteritems()
14+
])
15+
return '{0}({1})'.format(self.__class__.__name__, attrs)
1016

1117

1218
class ResourceError(BalancedError):

balanced/resources.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ def items(self):
132132
# there is no resources key in the response from server
133133
# if the list is empty, so when we try to get something like
134134
# `debits`, an AttributeError will be raised. Not sure is this
135-
# behavior a bug of server, but anyway, this is just a workaround here
136-
# for solving the problem. The issue was posted here
135+
# behavior a bug of server, but anyway, this is just a workaround
136+
# here for solving the problem. The issue was posted here
137137
# https://github.com/balanced/balanced-python/issues/93
138138
return []
139139

examples/bank_account_debits.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def main():
3535

3636
print 'PROTIP: for TEST bank accounts the valid amount is always 1 and 1'
3737
try:
38-
verification.confirm(amount_1=1, amount_2=1)
38+
verification.confirm(amount_1=1, amount_2=2)
3939
except balanced.exc.BankAccountVerificationFailure as ex:
4040
print 'Authentication error , %s' % ex.message
4141

0 commit comments

Comments
 (0)