Skip to content

Commit b4bc81e

Browse files
committed
Add scenarios for accounts and settlements
1 parent 6bda120 commit b4bc81e

File tree

170 files changed

+499
-315
lines changed

Some content is hidden

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

170 files changed

+499
-315
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import balanced
22

3-
balanced.configure('ak-test-1o9QKwUCrwstHWO5sGxICtIJdQXFTjnrV')
3+
balanced.configure('ak-test-2wIOi20ITgc1u1Lw6UM3y5ZZjZ66M8HMf')
44

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

scenarios/_mj/api_key_create/python.mako

Lines changed: 2 additions & 2 deletions
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-2wIOi20ITgc1u1Lw6UM3y5ZZjZ66M8HMf')
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-17T00:36:44.621325Z', secret=u'ak-test-2zkVyNvJLrBn4mc1udeR9S2CFXCQvzWKN', href=u'/api_keys/AK4e2JjsmVYES9oUwqRYg8hy', meta={}, id=u'AK4e2JjsmVYES9oUwqRYg8hy')
1313
% endif
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
balanced.Account.credit()
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import balanced
2+
3+
balanced.configure('ak-test-2wIOi20ITgc1u1Lw6UM3y5ZZjZ66M8HMf')
4+
5+
payable_account = balanced.Account.fetch('/accounts/AT43cMKrvwKEJnV5qX8wCqY0')
6+
payable_account.credit(
7+
appears_on_statement_as='ThingsCo',
8+
amount=1000,
9+
description='A simple credit',
10+
order='/orders/OR483MoeOnJEXwkxqoPdnDF3'meta[rating]=8,
11+
)
Lines changed: 17 additions & 0 deletions
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-2wIOi20ITgc1u1Lw6UM3y5ZZjZ66M8HMf')
7+
8+
payable_account = balanced.Account.fetch('/accounts/AT43cMKrvwKEJnV5qX8wCqY0')
9+
payable_account.credit(
10+
appears_on_statement_as='ThingsCo',
11+
amount=1000,
12+
description='A simple credit',
13+
order='/orders/OR483MoeOnJEXwkxqoPdnDF3'meta[rating]=8,
14+
)
15+
% elif mode == 'response':
16+
Credit(status=u'succeeded', description=u'A simple credit', links={u'customer': u'CU42QGL6X08UHbQnRqgCNtKg', u'destination': u'AT43cMKrvwKEJnV5qX8wCqY0', u'order': u'OR483MoeOnJEXwkxqoPdnDF3'}, amount=1000, created_at=u'2014-12-18T18:37:17.500080Z', updated_at=u'2014-12-18T18:37:17.620931Z', failure_reason=None, currency=u'USD', transaction_number=u'CRA2V-TJP-CBO8', href=u'/credits/CR54cX9URL7OXgy3jOxCdgPe', meta={u'rating': u'8'}, failure_reason_code=None, appears_on_statement_as=u'ThingsCo', id=u'CR54cX9URL7OXgy3jOxCdgPe')
17+
% endif
Lines changed: 7 additions & 0 deletions
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+
)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
balanced.Account.query
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import balanced
2+
3+
balanced.configure('ak-test-2wIOi20ITgc1u1Lw6UM3y5ZZjZ66M8HMf')
4+
5+
accounts = balanced.Account.query

scenarios/account_list/python.mako

Lines changed: 12 additions & 0 deletions
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-2wIOi20ITgc1u1Lw6UM3y5ZZjZ66M8HMf')
8+
9+
accounts = balanced.Account.query
10+
% elif mode == 'response':
11+
12+
% endif
Lines changed: 4 additions & 0 deletions
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

0 commit comments

Comments
 (0)