Skip to content

Commit d720dc3

Browse files
committed
Merge pull request #138 from balanced/acounts_settlements_scenarios
Add scenarios for accounts and settlements
2 parents bf874b3 + 733459f commit d720dc3

File tree

176 files changed

+522
-338
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+522
-338
lines changed
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import balanced
22

3-
balanced.configure('ak-test-25ZY8HQwZPuQtDecrxb671LilUya5t5G0')
3+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
44

55
api_key = balanced.APIKey()
66
api_key.save()

scenarios/_mj/api_key_create/python.mako

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ balanced.APIKey
44
% elif mode == 'request':
55
import balanced
66

7-
balanced.configure('ak-test-aUV295IugdhWSNx2JFckYBCSvfY2ibgq')
7+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
88

99
api_key = balanced.APIKey()
1010
api_key.save()
1111
% elif mode == 'response':
12-
APIKey(links={}, created_at=u'2014-04-25T21:59:54.024155Z', secret=u'ak-test-2ouh9CXrssudvHruEZ1Ymcrna05kmigfw', href=u'/api_keys/AK7gg5FNb0Owb6hErcMm0CZ7', meta={}, id=u'AK7gg5FNb0Owb6hErcMm0CZ7')
12+
APIKey(links={}, created_at=u'2014-12-18T18:20:54.950589Z', secret=u'ak-test-2s6vMXj5TtFJzMDptyJufa0QObbpZkWqf', href=u'/api_keys/AK2Phglc8FZEbSJWy3H7UeB7', meta={}, id=u'AK2Phglc8FZEbSJWy3H7UeB7')
1313
% endif
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
balanced.Account.credit()
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import balanced
2+
3+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
4+
5+
payable_account = balanced.Account.fetch('/accounts/AT2E6Ju62P9AnTJwe0fL5kOI')
6+
payable_account.credit(
7+
appears_on_statement_as='ThingsCo',
8+
amount=1000,
9+
description='A simple credit',
10+
order='/orders/OR2JfBYxYlDAF3L48u9DtIEU'meta[rating]=8,
11+
)

scenarios/account_credit/python.mako

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
% if mode == 'definition':
2+
balanced.Account.credit()
3+
% elif mode == 'request':
4+
import balanced
5+
6+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
7+
8+
payable_account = balanced.Account.fetch('/accounts/AT2E6Ju62P9AnTJwe0fL5kOI')
9+
payable_account.credit(
10+
appears_on_statement_as='ThingsCo',
11+
amount=1000,
12+
description='A simple credit',
13+
order='/orders/OR2JfBYxYlDAF3L48u9DtIEU'meta[rating]=8,
14+
)
15+
% elif mode == 'response':
16+
Credit(status=u'succeeded', description=u'A simple credit', links={u'customer': u'CU2DRnwOXfbxBlKb5CUWwWJi', u'destination': u'AT2E6Ju62P9AnTJwe0fL5kOI', u'order': u'OR2JfBYxYlDAF3L48u9DtIEU'}, amount=1000, created_at=u'2014-12-19T19:33:31.202845Z', updated_at=u'2014-12-19T19:33:31.295273Z', failure_reason=None, currency=u'USD', transaction_number=u'CR77S-5TO-YRYQ', href=u'/credits/CR5bM6mv38qwW1NEo0ssJTiR', meta={u'rating': u'8'}, failure_reason_code=None, appears_on_statement_as=u'ThingsCo', id=u'CR5bM6mv38qwW1NEo0ssJTiR')
17+
% endif

scenarios/account_credit/request.mako

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<%namespace file='/_main.mako' name='main'/>
2+
<% main.python_boilerplate() %>
3+
4+
payable_account = balanced.Account.fetch('${request['href']}')
5+
payable_account.credit(
6+
<% main.payload_expand(request['payload']) %>
7+
)
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
balanced.Account.query

scenarios/account_list/executable.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import balanced
2+
3+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
4+
5+
accounts = balanced.Account.query

scenarios/account_list/python.mako

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
% if mode == 'definition':
2+
balanced.Account.query
3+
4+
% elif mode == 'request':
5+
import balanced
6+
7+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
8+
9+
accounts = balanced.Account.query
10+
% elif mode == 'response':
11+
12+
% endif

scenarios/account_list/request.mako

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<%namespace file='/_main.mako' name='main'/>
2+
<% main.python_boilerplate() %>
3+
4+
accounts = balanced.Account.query
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
balanced.Account.query
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import balanced
2+
3+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
4+
5+
customer = balanced.Customer.fetch('/customers/CU4CZc7Xjn8gGJXl1LyzZk7S')
6+
customer.accounts
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
% if mode == 'definition':
2+
balanced.Account.query
3+
4+
% elif mode == 'request':
5+
import balanced
6+
7+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
8+
9+
customer = balanced.Customer.fetch('/customers/CU4CZc7Xjn8gGJXl1LyzZk7S')
10+
customer.accounts
11+
% elif mode == 'response':
12+
13+
% endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<%namespace file='/_main.mako' name='main'/>
2+
<% main.python_boilerplate() %>
3+
4+
customer = balanced.Customer.fetch('${request['customer_href']}')
5+
customer.accounts
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
balanced.Account.fetch()

scenarios/account_show/executable.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import balanced
2+
3+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
4+
5+
account = balanced.Account.fetch('/accounts/AT2t2NS6otEMnPT0jVuRAE6Y')

scenarios/account_show/python.mako

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
% if mode == 'definition':
2+
balanced.Account.fetch()
3+
4+
% elif mode == 'request':
5+
import balanced
6+
7+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
8+
9+
account = balanced.Account.fetch('/accounts/AT2t2NS6otEMnPT0jVuRAE6Y')
10+
% elif mode == 'response':
11+
Account(links={u'customer': u'CU2sWdT0agfxWIbJN2W5LR0k'}, can_credit=True, can_debit=True, created_at=u'2014-12-18T18:20:35.215938Z', updated_at=u'2014-12-18T18:20:35.215939Z', currency=u'USD', href=u'/accounts/AT2t2NS6otEMnPT0jVuRAE6Y', meta={}, balance=0, type=u'payable', id=u'AT2t2NS6otEMnPT0jVuRAE6Y')
12+
% endif

scenarios/account_show/request.mako

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<%namespace file='/_main.mako' name='main'/>
2+
<% main.python_boilerplate() %>
3+
4+
account = balanced.Account.fetch('${request['uri']}')
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import balanced
22

3-
balanced.configure('ak-test-25ZY8HQwZPuQtDecrxb671LilUya5t5G0')
3+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
44

55
api_key = balanced.APIKey().save()

scenarios/api_key_create/python.mako

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ balanced.APIKey()
33
% elif mode == 'request':
44
import balanced
55

6-
balanced.configure('ak-test-25ZY8HQwZPuQtDecrxb671LilUya5t5G0')
6+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
77

88
api_key = balanced.APIKey().save()
99
% elif mode == 'response':
10-
APIKey(links={}, created_at=u'2014-11-14T19:26:45.904618Z', secret=u'ak-test-2xP79D9WIwTI77JPABpo8uL8cqgEFq2c', href=u'/api_keys/AKJnLWedoBhUHpdhoGEOPew', meta={}, id=u'AKJnLWedoBhUHpdhoGEOPew')
10+
APIKey(links={}, created_at=u'2014-12-18T18:20:54.950589Z', secret=u'ak-test-2s6vMXj5TtFJzMDptyJufa0QObbpZkWqf', href=u'/api_keys/AK2Phglc8FZEbSJWy3H7UeB7', meta={}, id=u'AK2Phglc8FZEbSJWy3H7UeB7')
1111
% endif
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import balanced
22

3-
balanced.configure('ak-test-25ZY8HQwZPuQtDecrxb671LilUya5t5G0')
3+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
44

5-
key = balanced.APIKey.fetch('/api_keys/AKJnLWedoBhUHpdhoGEOPew')
5+
key = balanced.APIKey.fetch('/api_keys/AK2Phglc8FZEbSJWy3H7UeB7')
66
key.delete()

scenarios/api_key_delete/python.mako

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ balanced.APIKey().delete()
33
% elif mode == 'request':
44
import balanced
55

6-
balanced.configure('ak-test-25ZY8HQwZPuQtDecrxb671LilUya5t5G0')
6+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
77

8-
key = balanced.APIKey.fetch('/api_keys/AKJnLWedoBhUHpdhoGEOPew')
8+
key = balanced.APIKey.fetch('/api_keys/AK2Phglc8FZEbSJWy3H7UeB7')
99
key.delete()
1010
% elif mode == 'response':
1111

scenarios/api_key_list/executable.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import balanced
22

3-
balanced.configure('ak-test-25ZY8HQwZPuQtDecrxb671LilUya5t5G0')
3+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
44

55
keys = balanced.APIKey.query

scenarios/api_key_list/python.mako

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ balanced.APIKey.query
44
% elif mode == 'request':
55
import balanced
66

7-
balanced.configure('ak-test-25ZY8HQwZPuQtDecrxb671LilUya5t5G0')
7+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
88

99
keys = balanced.APIKey.query
1010
% elif mode == 'response':

scenarios/api_key_show/executable.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import balanced
22

3-
balanced.configure('ak-test-25ZY8HQwZPuQtDecrxb671LilUya5t5G0')
3+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
44

5-
key = balanced.APIKey.fetch('/api_keys/AKJnLWedoBhUHpdhoGEOPew')
5+
key = balanced.APIKey.fetch('/api_keys/AK2Phglc8FZEbSJWy3H7UeB7')

scenarios/api_key_show/python.mako

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ balanced.APIKey.fetch()
44
% elif mode == 'request':
55
import balanced
66

7-
balanced.configure('ak-test-25ZY8HQwZPuQtDecrxb671LilUya5t5G0')
7+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
88

9-
key = balanced.APIKey.fetch('/api_keys/AKJnLWedoBhUHpdhoGEOPew')
9+
key = balanced.APIKey.fetch('/api_keys/AK2Phglc8FZEbSJWy3H7UeB7')
1010
% elif mode == 'response':
11-
APIKey(created_at=u'2014-11-14T19:26:45.904618Z', href=u'/api_keys/AKJnLWedoBhUHpdhoGEOPew', meta={}, id=u'AKJnLWedoBhUHpdhoGEOPew', links={})
11+
APIKey(created_at=u'2014-12-18T18:20:54.950589Z', href=u'/api_keys/AK2Phglc8FZEbSJWy3H7UeB7', meta={}, id=u'AK2Phglc8FZEbSJWy3H7UeB7', links={})
1212
% endif
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import balanced
22

3-
balanced.configure('ak-test-25ZY8HQwZPuQtDecrxb671LilUya5t5G0')
3+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
44

5-
bank_account = balanced.BankAccount.fetch('/bank_accounts/BA2gul8YMjFWnFk0fFHXwX6g')
6-
bank_account.associate_to_customer('/customers/CU2718cI8PkMdFyPjboZLZfn')
5+
bank_account = balanced.BankAccount.fetch('/bank_accounts/BA3uzbngfVXy1SGg25Et7iKY')
6+
bank_account.associate_to_customer('/customers/CU2DRnwOXfbxBlKb5CUWwWJi')

scenarios/bank_account_associate_to_customer/python.mako

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ balanced.BankAccount().associate_to_customer()
33
% elif mode == 'request':
44
import balanced
55

6-
balanced.configure('ak-test-25ZY8HQwZPuQtDecrxb671LilUya5t5G0')
6+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
77

8-
bank_account = balanced.BankAccount.fetch('/bank_accounts/BA2gul8YMjFWnFk0fFHXwX6g')
9-
bank_account.associate_to_customer('/customers/CU2718cI8PkMdFyPjboZLZfn')
8+
bank_account = balanced.BankAccount.fetch('/bank_accounts/BA3uzbngfVXy1SGg25Et7iKY')
9+
bank_account.associate_to_customer('/customers/CU2DRnwOXfbxBlKb5CUWwWJi')
1010
% elif mode == 'response':
11-
BankAccount(routing_number=u'121000358', bank_name=u'BANK OF AMERICA, N.A.', account_type=u'checking', name=u'Johann Bernoulli', links={u'customer': u'CU2718cI8PkMdFyPjboZLZfn', u'bank_account_verification': None}, can_credit=True, created_at=u'2014-11-14T19:28:10.468801Z', address={u'city': None, u'line2': None, u'line1': None, u'state': None, u'postal_code': None, u'country_code': None}, updated_at=u'2014-11-14T19:28:11.068363Z', href=u'/bank_accounts/BA2gul8YMjFWnFk0fFHXwX6g', meta={}, account_number=u'xxxxxx0001', fingerprint=u'5f0ba9fa3f1122ef13b944a40abfe44e7eba9e16934e64200913cb4c402ace14', can_debit=False, id=u'BA2gul8YMjFWnFk0fFHXwX6g')
11+
BankAccount(routing_number=u'121000358', bank_name=u'BANK OF AMERICA, N.A.', account_type=u'checking', name=u'Johann Bernoulli', links={u'customer': u'CU2DRnwOXfbxBlKb5CUWwWJi', u'bank_account_verification': None}, can_credit=True, created_at=u'2014-12-18T18:21:31.663217Z', address={u'city': None, u'line2': None, u'line1': None, u'state': None, u'postal_code': None, u'country_code': None}, updated_at=u'2014-12-18T18:21:32.166444Z', href=u'/bank_accounts/BA3uzbngfVXy1SGg25Et7iKY', meta={}, account_number=u'xxxxxx0001', fingerprint=u'5f0ba9fa3f1122ef13b944a40abfe44e7eba9e16934e64200913cb4c402ace14', can_debit=False, id=u'BA3uzbngfVXy1SGg25Et7iKY')
1212
% endif

scenarios/bank_account_create/executable.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import balanced
22

3-
balanced.configure('ak-test-25ZY8HQwZPuQtDecrxb671LilUya5t5G0')
3+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
44

55
bank_account = balanced.BankAccount(
66
routing_number='121000358',

scenarios/bank_account_create/python.mako

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ balanced.BankAccount().save()
33
% elif mode == 'request':
44
import balanced
55

6-
balanced.configure('ak-test-25ZY8HQwZPuQtDecrxb671LilUya5t5G0')
6+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
77

88
bank_account = balanced.BankAccount(
99
routing_number='121000358',
@@ -12,5 +12,5 @@ bank_account = balanced.BankAccount(
1212
name='Johann Bernoulli'
1313
).save()
1414
% elif mode == 'response':
15-
BankAccount(routing_number=u'121000358', bank_name=u'BANK OF AMERICA, N.A.', account_type=u'checking', name=u'Johann Bernoulli', links={u'customer': None, u'bank_account_verification': None}, can_credit=True, created_at=u'2014-11-14T19:28:10.468801Z', address={u'city': None, u'line2': None, u'line1': None, u'state': None, u'postal_code': None, u'country_code': None}, updated_at=u'2014-11-14T19:28:10.468802Z', href=u'/bank_accounts/BA2gul8YMjFWnFk0fFHXwX6g', meta={}, account_number=u'xxxxxx0001', fingerprint=u'5f0ba9fa3f1122ef13b944a40abfe44e7eba9e16934e64200913cb4c402ace14', can_debit=False, id=u'BA2gul8YMjFWnFk0fFHXwX6g')
15+
BankAccount(routing_number=u'121000358', bank_name=u'BANK OF AMERICA, N.A.', account_type=u'checking', name=u'Johann Bernoulli', links={u'customer': None, u'bank_account_verification': None}, can_credit=True, created_at=u'2014-12-18T18:21:31.663217Z', address={u'city': None, u'line2': None, u'line1': None, u'state': None, u'postal_code': None, u'country_code': None}, updated_at=u'2014-12-18T18:21:31.663218Z', href=u'/bank_accounts/BA3uzbngfVXy1SGg25Et7iKY', meta={}, account_number=u'xxxxxx0001', fingerprint=u'5f0ba9fa3f1122ef13b944a40abfe44e7eba9e16934e64200913cb4c402ace14', can_debit=False, id=u'BA3uzbngfVXy1SGg25Et7iKY')
1616
% endif
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import balanced
22

3-
balanced.configure('ak-test-25ZY8HQwZPuQtDecrxb671LilUya5t5G0')
3+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
44

5-
bank_account = balanced.BankAccount.fetch('/bank_accounts/BA2gul8YMjFWnFk0fFHXwX6g')
5+
bank_account = balanced.BankAccount.fetch('/bank_accounts/BA3uzbngfVXy1SGg25Et7iKY')
66
bank_account.credit(
77
amount=5000
88
)

scenarios/bank_account_credit/python.mako

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ balanced.BankAccount().credit()
33
% elif mode == 'request':
44
import balanced
55

6-
balanced.configure('ak-test-25ZY8HQwZPuQtDecrxb671LilUya5t5G0')
6+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
77

8-
bank_account = balanced.BankAccount.fetch('/bank_accounts/BA2gul8YMjFWnFk0fFHXwX6g')
8+
bank_account = balanced.BankAccount.fetch('/bank_accounts/BA3uzbngfVXy1SGg25Et7iKY')
99
bank_account.credit(
1010
amount=5000
1111
)
1212
% elif mode == 'response':
13-
Credit(status=u'pending', description=None, links={u'customer': u'CU2718cI8PkMdFyPjboZLZfn', u'destination': u'BA2gul8YMjFWnFk0fFHXwX6g', u'order': None}, amount=5000, created_at=u'2014-11-14T19:31:16.741168Z', updated_at=u'2014-11-14T19:31:17.234505Z', failure_reason=None, currency=u'USD', transaction_number=u'CRZ2P-NW9-NTU2', href=u'/credits/CR5DQV6PdifnxDMmethpLIGN', meta={}, failure_reason_code=None, appears_on_statement_as=u'example.com', id=u'CR5DQV6PdifnxDMmethpLIGN')
13+
Credit(status=u'pending', description=None, links={u'customer': u'CU2DRnwOXfbxBlKb5CUWwWJi', u'destination': u'BA3uzbngfVXy1SGg25Et7iKY', u'order': None}, amount=5000, created_at=u'2014-12-18T18:23:17.134381Z', updated_at=u'2014-12-18T18:23:17.459321Z', failure_reason=None, currency=u'USD', transaction_number=u'CRMY6-6AZ-YV3J', href=u'/credits/CR5pb9ux8RYVNTwcJ3jdVF84', meta={}, failure_reason_code=None, appears_on_statement_as=u'example.com', id=u'CR5pb9ux8RYVNTwcJ3jdVF84')
1414
% endif
-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +0,0 @@
1-
import balanced
2-
3-
balanced.configure('ak-test-25ZY8HQwZPuQtDecrxb671LilUya5t5G0')
4-
5-
bank_account = balanced.BankAccount.fetch('/bank_accounts/BA17zYxBNrmg9isvicjz9Ae4')
6-
bank_account.debit(
7-
appears_on_statement_as='Statement text',
8-
amount=5000,
9-
description='Some descriptive text for the debit in the dashboard'
10-
)
+1-10
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
% if mode == 'definition':
22
balanced.BankAccount().debit()
33
% elif mode == 'request':
4-
import balanced
54

6-
balanced.configure('ak-test-25ZY8HQwZPuQtDecrxb671LilUya5t5G0')
7-
8-
bank_account = balanced.BankAccount.fetch('/bank_accounts/BA17zYxBNrmg9isvicjz9Ae4')
9-
bank_account.debit(
10-
appears_on_statement_as='Statement text',
11-
amount=5000,
12-
description='Some descriptive text for the debit in the dashboard'
13-
)
145
% elif mode == 'response':
15-
Debit(status=u'pending', description=u'Some descriptive text for the debit in the dashboard', links={u'customer': None, u'source': u'BA17zYxBNrmg9isvicjz9Ae4', u'dispute': None, u'order': None, u'card_hold': None}, amount=5000, created_at=u'2014-11-14T19:28:20.531858Z', updated_at=u'2014-11-14T19:28:20.985200Z', failure_reason=None, currency=u'USD', transaction_number=u'WSVJ-8FD-G2UK', href=u'/debits/WD2rNbc5IxoDIyiumypsUMtv', meta={}, failure_reason_code=None, appears_on_statement_as=u'BAL*Statement text', id=u'WD2rNbc5IxoDIyiumypsUMtv')
6+
167
% endif

scenarios/bank_account_debit_order/executable.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import balanced
22

3-
balanced.configure('ak-test-25ZY8HQwZPuQtDecrxb671LilUya5t5G0')
3+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
44

5-
order = balanced.Order.fetch('/orders/OR5sl2RJVnbwEf45nq5eATdz')
6-
bank_account = balanced.BankAccount.fetch('/bank_accounts/BA17zYxBNrmg9isvicjz9Ae4')
5+
order = balanced.Order.fetch('/orders/OR2JfBYxYlDAF3L48u9DtIEU')
6+
bank_account = balanced.BankAccount.fetch('/bank_accounts/BA305R4Vwumo1KjT9kwVrdfT')
77
order.debit_from(
88
amount=5000,
99
source=bank_account,

scenarios/bank_account_debit_order/python.mako

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ balanced.Order().debit_from()
44
% elif mode == 'request':
55
import balanced
66

7-
balanced.configure('ak-test-25ZY8HQwZPuQtDecrxb671LilUya5t5G0')
7+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
88

9-
order = balanced.Order.fetch('/orders/OR5sl2RJVnbwEf45nq5eATdz')
10-
bank_account = balanced.BankAccount.fetch('/bank_accounts/BA17zYxBNrmg9isvicjz9Ae4')
9+
order = balanced.Order.fetch('/orders/OR2JfBYxYlDAF3L48u9DtIEU')
10+
bank_account = balanced.BankAccount.fetch('/bank_accounts/BA305R4Vwumo1KjT9kwVrdfT')
1111
order.debit_from(
1212
amount=5000,
1313
source=bank_account,
1414
)
1515
% elif mode == 'response':
16-
Debit(status=u'pending', description=u'New description for order', links={u'customer': None, u'source': u'BA17zYxBNrmg9isvicjz9Ae4', u'dispute': None, u'order': u'OR5sl2RJVnbwEf45nq5eATdz', u'card_hold': None}, amount=5000, created_at=u'2014-11-14T19:32:12.424415Z', updated_at=u'2014-11-14T19:32:12.989360Z', failure_reason=None, currency=u'USD', transaction_number=u'W5OI-0K3-GLCQ', href=u'/debits/WD6EB5Jvfr4PTxUJB3HFTGVn', meta={}, failure_reason_code=None, appears_on_statement_as=u'BAL*example.com', id=u'WD6EB5Jvfr4PTxUJB3HFTGVn')
16+
Debit(status=u'pending', description=u'Order #12341234', links={u'customer': None, u'source': u'BA305R4Vwumo1KjT9kwVrdfT', u'dispute': None, u'order': u'OR2JfBYxYlDAF3L48u9DtIEU', u'card_hold': None}, amount=5000, created_at=u'2014-12-18T18:21:34.869249Z', updated_at=u'2014-12-18T18:21:35.142979Z', failure_reason=None, currency=u'USD', transaction_number=u'WQUD-1BL-3KIM', href=u'/debits/WD3yawZGsngL3dLqW0YpEEcE', meta={}, failure_reason_code=None, appears_on_statement_as=u'BAL*example.com', id=u'WD3yawZGsngL3dLqW0YpEEcE')
1717
% endif
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import balanced
22

3-
balanced.configure('ak-test-25ZY8HQwZPuQtDecrxb671LilUya5t5G0')
3+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
44

5-
bank_account = balanced.BankAccount.fetch('/bank_accounts/BA1D19WqGc3j78IAhFIkasQd')
5+
bank_account = balanced.BankAccount.fetch('/bank_accounts/BA3gt4RLskm2w09aXHPDaCb3')
66
bank_account.delete()

0 commit comments

Comments
 (0)