Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from SimpleQIWI import *
- import json
- import time
- N53 = 'NUMBER'
- api53 = 'API' # https://qiwi.com/api
- api53 = QApi(token=api53, phone=N53)
- testing2 = json.dumps(api53.payments, indent=4)
- testing1 = json.loads(testing2)
- txnId_forBOT = testing1['data'][0]['txnId']
- trmTxnId_forBOT = testing1['data'][0]['trmTxnId']
- status_forBOT = testing1['data'][0]['status']
- print(testing1['data'][0]['sum']['amount'])
- def checking_forWHILE():
- global api53
- testing2 = json.dumps(api53.payments, indent=4)
- testing1 = json.loads(testing2)
- txnId_forBOT2 = testing1['data'][0]['txnId']
- trmTxnId_forBOT2 = testing1['data'][0]['trmTxnId']
- status_forBOT2 = testing1['data'][0]['status']
- return txnId_forBOT2, trmTxnId_forBOT2, status_forBOT2
- def checking_newPAY():
- while True:
- global txnId_forBOT
- global trmTxnId_forBOT
- global status_forBOT
- data = checking_forWHILE()
- txnId_forIN = data[0]
- trmTxnId_forIN = data[1]
- status_forIN = data[2]
- if txnId_forBOT != txnId_forIN or trmTxnId_forBOT != trmTxnId_forIN and status_forIN == 'Success':
- print('НОВЫЙ ПЕРЕВОД!')
- txnId_forBOT = txnId_forIN
- trmTxnId_forBOT = trmTxnId_forIN
- status_forBOT = status_forIN
- else:
- time.sleep(10)
- pass
- checking_newPAY()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement