KongYang commited on
Commit
1ccc530
1 Parent(s): fd0793c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -12
app.py CHANGED
@@ -122,24 +122,20 @@ def pay(auth_id):
122
  first_results = request_first(authorization)
123
  if first_results!=None:
124
  third_no,fee,begin,duration,user_id = first_results
125
- print(f"================time={datetime.now()}================")
126
  print("third_no:",third_no, "入场时间:", begin, "用户ID:", user_id,"停车时长:",duration, "费用:",fee)
127
- # # //////////////////////////////2//////////////////////////////////////////////////////
128
  order_number = request_second(authorization,third_no,fee,begin)
129
- print("order_number:",order_number)
130
- # # /////////////////////////////3//////////////////////////////////////////////////////
131
  resultCode = request_third(order_number)
132
  if resultCode == 2323:
133
- print(f"=================time={datetime.now()}=============")
134
- return "缴费成功"
135
  elif resultCode == 3138:
136
- print(f"=============系统繁忙,休息300秒===================")
137
- return "请求频繁,系统拒绝"
138
  elif resultCode == 0:
139
- return "支付码已经使用,请换一个"
140
  else:
141
- print(f"--------------支付失败---{datetime.now()}----------")
142
- return "支付失败"
143
 
144
 
145
  else:
@@ -168,7 +164,7 @@ radio_num = []
168
  for k,v in enumerate(authorization_list):
169
  if v.startswith("Bearer"):
170
  radio_num.append(k)
171
- print(k,v)
172
 
173
 
174
  history = []
 
122
  first_results = request_first(authorization)
123
  if first_results!=None:
124
  third_no,fee,begin,duration,user_id = first_results
 
125
  print("third_no:",third_no, "入场时间:", begin, "用户ID:", user_id,"停车时长:",duration, "费用:",fee)
126
+
127
  order_number = request_second(authorization,third_no,fee,begin)
128
+ # print("order_number:",order_number)
129
+
130
  resultCode = request_third(order_number)
131
  if resultCode == 2323:
132
+ return f"缴费成功 {fee}"
 
133
  elif resultCode == 3138:
134
+ return f"请求频繁,系统拒绝 {fee}元"
 
135
  elif resultCode == 0:
136
+ return f"支付码已经使用,请换一个 {fee}元"
137
  else:
138
+ return f"支付失败 {fee}"
 
139
 
140
 
141
  else:
 
164
  for k,v in enumerate(authorization_list):
165
  if v.startswith("Bearer"):
166
  radio_num.append(k)
167
+ # print(k,v)
168
 
169
 
170
  history = []