-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathatm.py
More file actions
37 lines (30 loc) · 746 Bytes
/
atm.py
File metadata and controls
37 lines (30 loc) · 746 Bytes
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
import requests
import json
import sys # for testing
url = "http://192.168.1.114:5000"
args = {}
args['accountNum'] = "123456781"
args['password'] = "test3"
args['challenge'] = "1234"
loc = "/getSession"
response = requests.post(url+loc,data=args)
decodedOut = json.loads(response.text)
session = None
if isinstance(decodedOut, dict):
session = decodedOut['SessionID']
print session
else:
print decodedOut
sys.exit()
sys.exit()
args = {}
args['destAccount'] = "0112345678"
args['session'] = session
args['amount'] = "5.4"
loc = "/giveMoney"
response = requests.post(url+loc,data=args)
decodedOut = json.loads(response.text)
if isinstance(decodedOut, dict):
print decodedOut['Status']
else:
print decodedOut