-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.py
87 lines (63 loc) · 1.78 KB
/
example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import dwolla
KEY = 'key goes here'
SECRET = 'secret goes here'
TOKEN = 'token goes here'
# initialize dwolla
dwolla.init(KEY, SECRET, TOKEN)
"""
Part 1: Grab stats for user associated to the TOKEN
"""
stats = dwolla.Transactions.stats()
print stats.get('Response')
# Learn more about transaction status at https://developers.dwolla.com/dev/docs/transactions/stats
"""
Part 2: Grab all transactions for a user
"""
transactions = dwolla.Transactions.all()
print transactions.get('Response')
"""
Part 3: Grab detailed info about a transaction for a user
"""
transaction = dwolla.Transactions.retrieve(transactions.get('Response')[0]['Id'])
print transaction.get('Response')
"""
Part 4: Create and send guest transaction
"""
DUMMY_GUEST = dict(
client_id=KEY,
client_secret=SECRET,
firstName='Paul',
lastName='Revere',
emailAddress='[email protected]',
routingNumber='11111111',
accountNumber='17341818',
accountType='Savings',
destinationId='[email protected]',
amount='100000000'
)
transaction = dwolla.Transaction.create(is_guest=True, DUMMY_GUEST)
print transaction.get('Response')
# Learn more about guest transactions at https://developers.dwolla.com/dev/docs/transactions/guestsend
"""
Part 5: Register a user
"""
KEY = 'key goes here'
SECRET = 'secret goes here'
user = dwolla.User.create(
client_id=KEY,
client_secret=SECRET,
pin='1234',
email='[email protected]',
password='12345678',
firstName='Paul',
lastName='Revere',
address='1335 Broadway',
city='Boulder',
state='CO',
zip='80211',
phone='7134032345',
dateOfBirth='12-21-1734',
acceptTerms=True
)
print user.get('Response')
# Learn more about user registration at https://developers.dwolla.com/dev/docs/register/register