Skip to content

Commit cf8c857

Browse files
committed
Add dispute scenarios
1 parent 2995b86 commit cf8c857

File tree

16 files changed

+111
-0
lines changed

16 files changed

+111
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
balanced.Card().save()
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import balanced
2+
3+
balanced.configure('ak-test-1ByQgRpcQLTwmOhCBUofyIHm0r96qPm8s')
4+
5+
card = balanced.Card(
6+
cvv='123',
7+
expiration_month='12',
8+
number='6500000000000002',
9+
expiration_year='3000'
10+
).save()
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
% if mode == 'definition':
2+
balanced.Card().save()
3+
% elif mode == 'request':
4+
import balanced
5+
6+
balanced.configure('ak-test-1ByQgRpcQLTwmOhCBUofyIHm0r96qPm8s')
7+
8+
card = balanced.Card(
9+
cvv='123',
10+
expiration_month='12',
11+
number='6500000000000002',
12+
expiration_year='3000'
13+
).save()
14+
% elif mode == 'response':
15+
Card(cvv_match=u'yes', links={u'customer': None}, expiration_year=3000, avs_street_match=None, avs_postal_match=None, created_at=u'2014-04-17T22:39:50.334535Z', cvv_result=u'Match', number=u'xxxxxxxxxxxx0002', updated_at=u'2014-04-17T22:39:50.334538Z', expiration_month=12, cvv=u'xxx', href=u'/cards/CC1dQyiZY6h896UfGpBAWXOJ', meta={}, avs_result=None, address={u'city': None, u'line2': None, u'line1': None, u'state': None, u'postal_code': None, u'country_code': None}, id=u'CC1dQyiZY6h896UfGpBAWXOJ', fingerprint=u'3c667a62653e187f29b5781eeb0703f26e99558080de0c0f9490b5f9c4ac2871', is_verified=True, brand=u'Discover', name=None)
16+
% endif
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<%namespace file='/_main.mako' name='main'/>
2+
<% main.python_boilerplate() %>
3+
4+
card = balanced.Card(
5+
<% main.payload_expand(request['payload']) %>
6+
).save()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
balanced.Card().debit()
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import balanced
2+
3+
balanced.configure('ak-test-1ByQgRpcQLTwmOhCBUofyIHm0r96qPm8s')
4+
5+
card = balanced.Card.fetch('/cards/CC1dQyiZY6h896UfGpBAWXOJ')
6+
card.debit(
7+
appears_on_statement_as='Statement text',
8+
amount=5000,
9+
description='Some descriptive text for the debit in the dashboard'
10+
)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
% if mode == 'definition':
2+
balanced.Card().debit()
3+
% elif mode == 'request':
4+
import balanced
5+
6+
balanced.configure('ak-test-1ByQgRpcQLTwmOhCBUofyIHm0r96qPm8s')
7+
8+
card = balanced.Card.fetch('/cards/CC1dQyiZY6h896UfGpBAWXOJ')
9+
card.debit(
10+
appears_on_statement_as='Statement text',
11+
amount=5000,
12+
description='Some descriptive text for the debit in the dashboard'
13+
)
14+
% elif mode == 'response':
15+
Debit(status=u'succeeded', description=u'Some descriptive text for the debit in the dashboard', links={u'customer': None, u'source': u'CC1dQyiZY6h896UfGpBAWXOJ', u'order': None, u'dispute': None}, amount=5000, created_at=u'2014-04-17T22:39:51.088029Z', updated_at=u'2014-04-17T22:39:52.100741Z', failure_reason=None, currency=u'USD', transaction_number=u'W303-837-3548', href=u'/debits/WD1qIcVqGE1JrqFJuHH0d1pf', meta={}, failure_reason_code=None, appears_on_statement_as=u'BAL*Statement text', id=u'WD1qIcVqGE1JrqFJuHH0d1pf')
16+
% endif
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<%namespace file='/_main.mako' name='main'/>
2+
<% main.python_boilerplate() %>
3+
4+
card = balanced.Card.fetch('${request['card_href']}')
5+
card.debit(
6+
<% main.payload_expand(request['payload']) %>
7+
)
8+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
balanced.Dispute.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-1ByQgRpcQLTwmOhCBUofyIHm0r96qPm8s')
4+
5+
disputes = balanced.Dispute.query

0 commit comments

Comments
 (0)