forked from ytulsiani/MyAngelSight
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtsys.py
44 lines (31 loc) · 1.59 KB
/
tsys.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
import requests
from pprint import pprint
# curl -i -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer BWx/gfXk0RpFthUECBO0W0mKvyRCrVTdTkbxdv+DKT4=" https://developers.tsys.com/sandbox/rewards/00000022340/information
# curl -X POST -i -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer BWx/gfXk0RpFthUECBO0W0mKvyRCrVTdTkbxdv+DKT4=" https://developers.tsys.com/sandbox/rewards/00000013815/redemption/directdeposit
account_id = "00000022340"
access_token = "BWx/gfXk0RpFthUECBO0W0mKvyRCrVTdTkbxdv+DKT4="
def get_tsys():
headers = {"Authorization": "Bearer BWx/gfXk0RpFthUECBO0W0mKvyRCrVTdTkbxdv+DKT4=",
"Content-Type" : "application/json",
"Accept" : "application/json"}
url = "https://developers.tsys.com/sandbox/rewards/{}/information".format(account_id)
result = requests.get(url, headers=headers)
pprint(result.json())
def post_tsys():
url="https://developers.tsys.com/sandbox/rewards/{}/redemption/directdeposit".format("00000013815")
headers = {"Authorization": "Bearer BWx/gfXk0RpFthUECBO0W0mKvyRCrVTdTkbxdv+DKT4=",
"Content-Type" : "application/json",
"Accept" : "application/json"}
body = {
"transferAccountInfo": {
"routingNumber": "67867867868878",
"accountType": "Savings",
"accountNumber": "65765765675"
},
"rewardsValue": "10000"
}
result = requests.post(url, headers=headers)
pprint(result.json())
if __name__=="__main__":
# get_tsys()
post_tsys()