import re
from datetime import date
from dwolla import DwollaUser, DwollaClientApp

# User information
token = 'ENTER OAUTH TOKEN HERE'
DwollaUser = DwollaUser(token)


# Print user balance information
balance = DwollaUser.get_balance()
userID = DwollaUser.get_account_info()
print(userID['Name'] + ' (' + userID['Id'] + '), your current Dwolla balance is: $' + str(balance) + '\n')


# Get a list of user transactions
transactions = DwollaUser.get_transaction_list()
if len(transactions) >= 5:
    rVal = range(4,-1, -1)
else:
    rVal = range(len(transactions)-1, 0, -1)

print('Displaying summary data for your last ' + str(len(rVal)) + ' transactions')

# Print out individual transaction records
for val in rVal:
    # Get transaction ID number
    transaction_id = transactions[val]['Id']
    
    # Use ID number to get transaction metadata
    transaction = DwollaUser.get_transaction(transaction_id)
Пример #2
0
from dwolla import DwollaClientApp, DwollaUser

# Include any required keys
import _keys

# Instantiate a new Dwolla User client
# And, Sseed a previously generated access token
Dwolla = DwollaClientApp(_keys.apiKey, _keys.apiSecret)
DwollaUser = DwollaUser(_keys.token)
'''
    EXAMPLE 1: 
      Fetch account information for the
      account associated with the provided
      OAuth token
'''
me = DwollaUser.get_account_info()
print(me)
'''
    EXAMPLE 2: 
      Fetch basic account information
      for a given Dwolla ID
'''
me = Dwolla.get_account_info('812-626-8794')
print(me)
'''
    EXAMPLE 3: 
      Fetch basic account information
      for a given Email address
'''
me = Dwolla.get_account_info('*****@*****.**')
print(me)