-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
70 lines (53 loc) · 1.62 KB
/
test.py
File metadata and controls
70 lines (53 loc) · 1.62 KB
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
# -*- coding: utf-8 -*-
import requests
import json
import cv2
import numpy as np
print("결제하시겠습니까?")
input()
print("결제되었습니다.")
print("=================가상 데이터===============")
user = {
"email":ID,
"password":PASSWORD
}
login_res = requests.post('http://mmyu.synology.me:8080/user/login', data=json.dumps(user))
headers = {'Authorization': 'Bearer '+login_res.json()["access_token"]}
demo_data = {
"orderDate": "21/06/20",
"orderID": 1472583691,
"seller": "주단태",
"sellerEmail": "sellerEmail@example.co.kr",
"sellerHP": "010-0000-0000",
"orderItem": [
{
"menuId": 1,
"menuName": "생수",
"quantity": 4,
"price": 4000
},
{
"menuId": 2,
"menuName": "주단태빌리지 피규어",
"quantity": 1,
"price": 150000
}
]
}
print(f"결제일: {demo_data['orderDate']} 점주: {demo_data['seller']}")
for i in demo_data["orderItem"]:
print(i["menuName"], i["price"], i["quantity"], i["price"]*i["quantity"])
print("===========================================")
# res = requests.post('http://mmyu.synology.me:8080/receipt', data=json.dumps(demo_data),headers=headers)
url = 'https://ebook.nowon.kr/file/pfile/skin/qrcode_20181214220149.png'
# os.system("curl " + url + " > qr.jpg")
# imgFile = "qr.jpg"
# img = cv2.imread(imgFile, cv2.IMREAD_COLOR)
# cv2.imshow('QR', img)
# cv2.waitKey(0)
# cv2.destroyAllWindows()
image_nparray = np.asarray(bytearray(requests.get(url).content), dtype=np.uint8)
image = cv2.imdecode(image_nparray, cv2.IMREAD_COLOR)
cv2.imshow('QR', image)
cv2.waitKey(0)
print("감사합니다")