Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s = requests.Session()
- s.headers['authorization'] = 'Bearer ' + QIWI_TOKEN
- parameters = {'rows': '50'}
- h = s.get('https://edge.qiwi.com/payment-history/v1/persons/'+ QIWI_ACCOUNT +'/payments', params = parameters)
- req = json.loads(h.text)
- User = Query()
- users = db.search(User.userid == call.message.chat.id)
- userinf = users.pop()
- print(req)
- for i in range(len(req['data'])):
- print(i)
- if req['data'][i]['account'] == userinf['number']:
- if req['data'][i]['comment'] == userinf['code']:
- if req['data'][i]['sum']['amount'] == 1:
- bot.send_message(call.message.chat.id,"Успех")
- else:
- bot.send_message(call.message.chat.id, "Плохо")
Advertisement
Add Comment
Please, Sign In to add comment