Python how to run the cycle mnogopotochnoy API QIWI? and how to implement a restart of the cycle?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
198 views
The bottom line is this boat a telegram I want to implement a check payment.
1 Bot gives account
2, And starts the cycle verification
3 If a person paid for all the rules not errors, nothing
4 If you canceled the payment cycle to stop(long thought how to make xD)
But after someone does not matter who cancelled the cycle, any user then the bot just stops to produce a new account gives the error "OverridingEx", I began to catch that would not have taken off but the problem remained.

Can anyone tell how to solve the problem.
Use SimpleQIWI

The loop itself:
PS All I could comment

try: price = 1 #the price of the goods comment = api.bill(price) #Generates the review payment and then soobstvenno error keyboard = types.InlineKeyboardMarkup() #Keyboard keyboard.add(*[types.InlineKeyboardButton(text='Cancel', callback_data='Otenet')]) #Keyboard bot.send_message(x.message.chat.id, 'billed:\' 'The amount to be paid: 1 RUB\' 'QIWI wallet:' +str(qphone)+'\' 'Review of the payment: \'+str(comment)+'',reply_markup=keyboard, parse_mode="Html") api.start() #Runs the test coklend__asd = 2 #Variable to cancel the cycle a = 1 #Variable for the loop while a <= 5: #Well understood if api.check(comment): #If you find the review you will be missed bot.send_message(x.message.chat.id, 'Payment received!', parse_mode="Html") break else: time.sleep(5) #Sleep a += 1 #Add to the variable print(a) #Print api.stop()#Stop the test OverridingEx except: #Catch the error bot.send_message(x.message.chat.id, 'ERROR')


Here's the error itself:
P. S. do not even think to send me to read documentation SimpleQIWI, it is 1 project on github and nothing says.
C:\\Users\\saxar\\AppData\\Local\\Programs\\Python\\Python37-32\\python.exe D:/repos/untitled/MAIN.py 2019-02-04 10:25:27,678 (util.py:65 WorkerThread2) ERROR - TeleBot: "OverridingEx occurred, args=('Overriding bill!',) Traceback (most recent call last): File "C:\\Users\\saxar\\AppData\\Local\\Programs\\Python\\Python37-32\\lib\\site-packages\\telebot\\util.py", line 59, in run task(*args, **kwargs) File "D:/repos/untitled/MAIN.py", line 220, in inline comment = api.bill(price) File "C:\\Users\\saxar\\AppData\\Local\\Programs\\Python\\Python37-32\\lib\\site-packages\\SimpleQIWI\\Session.py", line 106, in bill raise OverridingEx('Overriding bill!') SimpleQIWI.Errors.OverridingEx: Overriding bill! " Traceback (most recent call last): File "D:/repos/untitled/MAIN.py", line 346, in bot.polling(none_stop=True) File "C:\\Users\\saxar\\AppData\\Local\\Programs\\Python\\Python37-32\\lib\\site-packages\\telebot\\__init__.py", line 389, in polling self.__threaded_polling(none_stop, interval, timeout) File "C:\\Users\\saxar\\AppData\\Local\\Programs\\Python\\Python37-32\\lib\\site-packages\\telebot\\__init__.py", line 413, in __threaded_polling self.worker_pool.raise_exceptions() File "C:\\Users\\saxar\\AppData\\Local\\Programs\\Python\\Python37-32\\lib\\site-packages\\telebot\\util.py", line 108, in raise_exceptions six.reraise(self.exc_info[0], self.exc_info[1], self.exc_info[2]) File "C:\\Users\\saxar\\AppData\\Local\\Programs\\Python\\Python37-32\\lib\\site-packages\\six.py", line 693, in reraise raise value File "C:\\Users\\saxar\\AppData\\Local\\Programs\\Python\\Python37-32\\lib\\site-packages\\telebot\\util.py", line 59, in run task(*args, **kwargs) File "D:/repos/untitled/MAIN.py", line 220, in inline comment = api.bill(price) File "C:\\Users\\saxar\\AppData\\Local\\Programs\\Python\\Python37-32\\lib\\site-packages\\SimpleQIWI\\Session.py", line 106, in bill raise OverridingEx('Overriding bill!') SimpleQIWI.Errors.OverridingEx: Overriding bill!
by | 198 views

1 Answer

0 like 0 dislike
Write a validation function which returns either OK or error. Run it in a loop, limiting the number of cycles.
by

Related questions

0 like 0 dislike
2 answers
asked May 11, 2019 by bastiang19
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked Jun 13, 2019 by NoirMort
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
36,634 users