-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
28 lines (22 loc) · 783 Bytes
/
main.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
#!/bin/env python3
import requests, json
from calypso import calypso
from reader import Reader
def main():
reader = Reader()
card = calypso.Calypso(reader.reader)
data = {}
data["atr"] = card.get_atr() # contactless does not provide atr data (only chip read)
data["icc"] = card.get_id() # sometimes is null TODO
data["environment"] = card.get_environment()
data["contracts"] = card.get_contracts()
data["history"] = card.get_history()
data["counters"] = card.get_counters()
print("Request:")
print(json.dumps(data, indent=4))
url = 'https://navegante.rijo.io/v1/card'
response = requests.post(url, json = data)
print("\nResponse:")
print(json.dumps(response.json(), indent=4))
if __name__ == '__main__':
main()