Skip to content

Commit 733459f

Browse files
committed
Update sceanrios
2 parents b4bc81e + bf874b3 commit 733459f

File tree

169 files changed

+444
-317
lines changed

Some content is hidden

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

169 files changed

+444
-317
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.2
2+
3+
* Account and Settlement support
4+
15
## 1.1.1
26

37
* Fix allowing for voiding holds

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Online Marketplace Payments
44

5-
[![Build Status](https://secure.travis-ci.org/balanced/balanced-python.png?branch=master)](http://travis-ci.org/balanced/balanced-python)
5+
[![Build Status](https://secure.travis-ci.org/balanced/balanced-python.png?branch=master)](http://travis-ci.org/balanced/balanced-python) [![Latest Version](https://pypip.in/version/balanced/badge.svg)](https://pypi.python.org/pypi/balanced/) [![Downloads](https://pypip.in/download/balanced/badge.svg)](https://pypi.python.org/pypi/balanced/) [![Supported Python versions](https://pypip.in/py_versions/balanced/badge.svg)](https://pypi.python.org/pypi/balanced/) [![License](https://pypip.in/license/balanced/badge.svg)](https://pypi.python.org/pypi/balanced/)
66

77
**v1.x requires Balanced API 1.1. Use [v0.x](https://github.com/balanced/balanced-python/tree/rev0) for Balanced API 1.0.**
88

balanced/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import unicode_literals
22

3-
__version__ = '1.1.1'
3+
__version__ = '1.2'
44

55
from balanced.config import configure
66
from balanced import resources
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import balanced
22

3-
balanced.configure('ak-test-2wIOi20ITgc1u1Lw6UM3y5ZZjZ66M8HMf')
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-2wIOi20ITgc1u1Lw6UM3y5ZZjZ66M8HMf')
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-12-17T00:36:44.621325Z', secret=u'ak-test-2zkVyNvJLrBn4mc1udeR9S2CFXCQvzWKN', href=u'/api_keys/AK4e2JjsmVYES9oUwqRYg8hy', meta={}, id=u'AK4e2JjsmVYES9oUwqRYg8hy')
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
+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import balanced
22

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

5-
payable_account = balanced.Account.fetch('/accounts/AT43cMKrvwKEJnV5qX8wCqY0')
5+
payable_account = balanced.Account.fetch('/accounts/AT2E6Ju62P9AnTJwe0fL5kOI')
66
payable_account.credit(
77
appears_on_statement_as='ThingsCo',
88
amount=1000,
99
description='A simple credit',
10-
order='/orders/OR483MoeOnJEXwkxqoPdnDF3'meta[rating]=8,
10+
order='/orders/OR2JfBYxYlDAF3L48u9DtIEU'meta[rating]=8,
1111
)

scenarios/account_credit/python.mako

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

6-
balanced.configure('ak-test-2wIOi20ITgc1u1Lw6UM3y5ZZjZ66M8HMf')
6+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
77

8-
payable_account = balanced.Account.fetch('/accounts/AT43cMKrvwKEJnV5qX8wCqY0')
8+
payable_account = balanced.Account.fetch('/accounts/AT2E6Ju62P9AnTJwe0fL5kOI')
99
payable_account.credit(
1010
appears_on_statement_as='ThingsCo',
1111
amount=1000,
1212
description='A simple credit',
13-
order='/orders/OR483MoeOnJEXwkxqoPdnDF3'meta[rating]=8,
13+
order='/orders/OR2JfBYxYlDAF3L48u9DtIEU'meta[rating]=8,
1414
)
1515
% 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')
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')
1717
% endif

scenarios/account_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-2wIOi20ITgc1u1Lw6UM3y5ZZjZ66M8HMf')
3+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
44

55
accounts = balanced.Account.query

scenarios/account_list/python.mako

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

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

99
accounts = balanced.Account.query
1010
% elif mode == 'response':
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import balanced
22

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

5-
customer = balanced.Customer.fetch('/customers/CU6sIkS1KUtHVoPUBM1Gf72B')
5+
customer = balanced.Customer.fetch('/customers/CU4CZc7Xjn8gGJXl1LyzZk7S')
66
customer.accounts

scenarios/account_list_customer/python.mako

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

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

9-
customer = balanced.Customer.fetch('/customers/CU6sIkS1KUtHVoPUBM1Gf72B')
9+
customer = balanced.Customer.fetch('/customers/CU4CZc7Xjn8gGJXl1LyzZk7S')
1010
customer.accounts
1111
% elif mode == 'response':
1212

scenarios/account_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-2wIOi20ITgc1u1Lw6UM3y5ZZjZ66M8HMf')
3+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
44

5-
account = balanced.Account.fetch('/accounts/AT3Se8weBm42ATmTA2bXjm73')
5+
account = balanced.Account.fetch('/accounts/AT2t2NS6otEMnPT0jVuRAE6Y')

scenarios/account_show/python.mako

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

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

9-
account = balanced.Account.fetch('/accounts/AT3Se8weBm42ATmTA2bXjm73')
9+
account = balanced.Account.fetch('/accounts/AT2t2NS6otEMnPT0jVuRAE6Y')
1010
% elif mode == 'response':
11-
Account(links={u'customer': u'CU3S7fOsPFkXduxLsRZgF57D'}, can_credit=True, can_debit=True, created_at=u'2014-12-17T00:36:25.254068Z', updated_at=u'2014-12-17T00:36:25.254070Z', currency=u'USD', href=u'/accounts/AT3Se8weBm42ATmTA2bXjm73', meta={}, balance=0, type=u'payable', id=u'AT3Se8weBm42ATmTA2bXjm73')
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')
1212
% endif
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import balanced
22

3-
balanced.configure('ak-test-2wIOi20ITgc1u1Lw6UM3y5ZZjZ66M8HMf')
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-2wIOi20ITgc1u1Lw6UM3y5ZZjZ66M8HMf')
6+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
77

88
api_key = balanced.APIKey().save()
99
% elif mode == 'response':
10-
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')
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-2wIOi20ITgc1u1Lw6UM3y5ZZjZ66M8HMf')
3+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
44

5-
key = balanced.APIKey.fetch('/api_keys/AK4e2JjsmVYES9oUwqRYg8hy')
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-2wIOi20ITgc1u1Lw6UM3y5ZZjZ66M8HMf')
6+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
77

8-
key = balanced.APIKey.fetch('/api_keys/AK4e2JjsmVYES9oUwqRYg8hy')
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-2wIOi20ITgc1u1Lw6UM3y5ZZjZ66M8HMf')
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-2wIOi20ITgc1u1Lw6UM3y5ZZjZ66M8HMf')
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-2wIOi20ITgc1u1Lw6UM3y5ZZjZ66M8HMf')
3+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
44

5-
key = balanced.APIKey.fetch('/api_keys/AK4e2JjsmVYES9oUwqRYg8hy')
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-2wIOi20ITgc1u1Lw6UM3y5ZZjZ66M8HMf')
7+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
88

9-
key = balanced.APIKey.fetch('/api_keys/AK4e2JjsmVYES9oUwqRYg8hy')
9+
key = balanced.APIKey.fetch('/api_keys/AK2Phglc8FZEbSJWy3H7UeB7')
1010
% elif mode == 'response':
11-
APIKey(created_at=u'2014-12-17T00:36:44.621325Z', href=u'/api_keys/AK4e2JjsmVYES9oUwqRYg8hy', meta={}, id=u'AK4e2JjsmVYES9oUwqRYg8hy', 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-2wIOi20ITgc1u1Lw6UM3y5ZZjZ66M8HMf')
3+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
44

5-
bank_account = balanced.BankAccount.fetch('/bank_accounts/BA4UZsYXpf2BX97v5WPaT57O')
6-
bank_account.associate_to_customer('/customers/CU42QGL6X08UHbQnRqgCNtKg')
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-2wIOi20ITgc1u1Lw6UM3y5ZZjZ66M8HMf')
6+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
77

8-
bank_account = balanced.BankAccount.fetch('/bank_accounts/BA4UZsYXpf2BX97v5WPaT57O')
9-
bank_account.associate_to_customer('/customers/CU42QGL6X08UHbQnRqgCNtKg')
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'CU42QGL6X08UHbQnRqgCNtKg', u'bank_account_verification': None}, can_credit=True, created_at=u'2014-12-17T00:37:22.811241Z', 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-17T00:37:23.326001Z', href=u'/bank_accounts/BA4UZsYXpf2BX97v5WPaT57O', meta={}, account_number=u'xxxxxx0001', fingerprint=u'5f0ba9fa3f1122ef13b944a40abfe44e7eba9e16934e64200913cb4c402ace14', can_debit=False, id=u'BA4UZsYXpf2BX97v5WPaT57O')
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-2wIOi20ITgc1u1Lw6UM3y5ZZjZ66M8HMf')
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-2wIOi20ITgc1u1Lw6UM3y5ZZjZ66M8HMf')
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-12-17T00:37:22.811241Z', 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-17T00:37:22.811243Z', href=u'/bank_accounts/BA4UZsYXpf2BX97v5WPaT57O', meta={}, account_number=u'xxxxxx0001', fingerprint=u'5f0ba9fa3f1122ef13b944a40abfe44e7eba9e16934e64200913cb4c402ace14', can_debit=False, id=u'BA4UZsYXpf2BX97v5WPaT57O')
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-2wIOi20ITgc1u1Lw6UM3y5ZZjZ66M8HMf')
3+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
44

5-
bank_account = balanced.BankAccount.fetch('/bank_accounts/BA4UZsYXpf2BX97v5WPaT57O')
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-2wIOi20ITgc1u1Lw6UM3y5ZZjZ66M8HMf')
6+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
77

8-
bank_account = balanced.BankAccount.fetch('/bank_accounts/BA4UZsYXpf2BX97v5WPaT57O')
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'CU42QGL6X08UHbQnRqgCNtKg', u'destination': u'BA4UZsYXpf2BX97v5WPaT57O', u'order': None}, amount=5000, created_at=u'2014-12-18T22:01:01.124567Z', updated_at=u'2014-12-18T22:01:01.453779Z', failure_reason=None, currency=u'USD', transaction_number=u'CRPNY-QIO-LQPD', href=u'/credits/CRRbC5ykVZmhoTfpZq6gy2s', meta={}, failure_reason_code=None, appears_on_statement_as=u'example.com', id=u'CRRbC5ykVZmhoTfpZq6gy2s')
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
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
balanced.Order().debit_from()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import balanced
2+
3+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
4+
5+
order = balanced.Order.fetch('/orders/OR2JfBYxYlDAF3L48u9DtIEU')
6+
bank_account = balanced.BankAccount.fetch('/bank_accounts/BA305R4Vwumo1KjT9kwVrdfT')
7+
order.debit_from(
8+
amount=5000,
9+
source=bank_account,
10+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
% if mode == 'definition':
2+
balanced.Order().debit_from()
3+
4+
% elif mode == 'request':
5+
import balanced
6+
7+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
8+
9+
order = balanced.Order.fetch('/orders/OR2JfBYxYlDAF3L48u9DtIEU')
10+
bank_account = balanced.BankAccount.fetch('/bank_accounts/BA305R4Vwumo1KjT9kwVrdfT')
11+
order.debit_from(
12+
amount=5000,
13+
source=bank_account,
14+
)
15+
% elif mode == 'response':
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')
17+
% endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<%namespace file='/_main.mako' name='main'/>
2+
<% main.python_boilerplate() %>
3+
4+
order = balanced.Order.fetch('${request['order_href']}')
5+
bank_account = balanced.BankAccount.fetch('${request['bank_account_href']}')
6+
order.debit_from(
7+
amount=${payload['amount']},
8+
source=bank_account,
9+
)
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import balanced
22

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

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

scenarios/bank_account_delete/python.mako

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

6-
balanced.configure('ak-test-2wIOi20ITgc1u1Lw6UM3y5ZZjZ66M8HMf')
6+
balanced.configure('ak-test-1xLFE6RLC1W3P4ePiQDI4UVpRwtKcdfqL')
77

8-
bank_account = balanced.BankAccount.fetch('/bank_accounts/BA4GVxlUHmn8y0CjAUEcW6Kp')
8+
bank_account = balanced.BankAccount.fetch('/bank_accounts/BA3gt4RLskm2w09aXHPDaCb3')
99
bank_account.delete()
1010
% elif mode == 'response':
1111

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

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

55
bank_accounts = balanced.BankAccount.query

scenarios/bank_account_list/python.mako

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

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

99
bank_accounts = balanced.BankAccount.query
1010
% elif mode == 'response':

0 commit comments

Comments
 (0)