-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdepositMoney.py
87 lines (62 loc) · 3.17 KB
/
depositMoney.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
86
87
#Function to withraw money from the individual's bank
#and then deposit in the central Onu Bank
#will then subtract from the Onu bank
#Also keeps track how much
import requests
import json
import random
import datetime
names = {"tester1":"5927271dceb8abe24250de57",
"tester2":"59272734ceb8abe24250de58"}
def transfer(moneyTransferred,payerID, receiverID):
url = "http://api.reimaginebanking.com/accounts/"+payerID+"/transfers"
querystring = {"key":"89e1407d751d9033c3bf258c76a33e79"}
# payload = '{"medium": "balance", "payee_id": receiverID, "amount": '+moneyTransferred+' ,"transaction_date": '+str(datetime.date.today())+', "description": "transferring money"}'
payload = json.dumps({"medium":"balance", "payee_id":receiverID, "amount":moneyTransferred, "transaction_date":str(datetime.date.today()), "description": "transferring money"})
print payload
headers = {
'content-type': "application/json",
'cache-control': "no-cache"
}
response = requests.request("POST", url, data=payload, headers=headers, params=querystring)
print(response.text)
transfer(2000,names["tester2"],names["tester1"])
# def getAccountID():
# #Glorys API key
# apiKey = '89e1407d751d9033c3bf258c76a33e79'
# #apiKey = '508de63e607d501fc1617f4e39315b86' #kims
# #apiKey = '89e1407d751d9033c3bf258c76a33e79'
# url = 'http://api.reimaginebanking.com/accounts?type=Checking&key={}'.format(apiKey)
# response = requests.get(url,)
# list_response = list(response.json())
# for i in range(0,len(list_response)):
# information_dic = list_response[i]
# print 'Nickname: ',information_dic['nickname'],'Account ID:', information_dic['_id'], 'Customer Id:',information_dic['customer_id']
# #if information_dic['customer_id'] == customerId and information_dic['type'] == 'Checking':
# # return information_dic['balance']
# customerId = '5926f38da73e4942cdafd65b'
# print(getBalance(customerId))
# #print("Depositing everyone's money...")
# #glory = ("592713b4ceb8abe24250de24", "59271449ceb8abe24250de2a")
# #kobi = "592713c2ceb8abe24250de28",
# #ben = "592713bfceb8abe24250de27"
# #kyle = "592713bcceb8abe24250de26"
# #kim = "592713baceb8abe24250de25"
# #group = {"glory":glory,"kobi":kobi,"ben":ben, "kyle":kyle, "kim":kim}
# #users = [
# """ {'name': kobi
# 'group_me_id': 'dfkladslfkjdsa'
# 'capitalone_id': 'fdkflsaff'
# },
# {}
# ]
# def groupAdd(name, customerID):
# group.update({name, customerID})
# def transfer(indivAmount):
# transferDate = datetime.date.today()
# for key, value in group.items():
# print key, "'s money is currently transferring to Onu..."
# print "Transfer complete"
# withdrawIndiv()
# #def depositOnu(total):
# #print total