P
P
Python Newbie2021-09-18 11:45:34
Python
Python Newbie, 2021-09-18 11:45:34

Error while working with api QIWI. What to do?

I have code:

from SimpleQIWI import *
token = config.CONFIG['qiwi']
phone = config.CONFIG['phone']
api = QApi(token=token, phone=phone)
api.pay(account=user_phone, amount=price, comment='перевод')


When I start the code, I get an error:
Traceback (most recent call last):
  File "main.py", line 462, in <module>
    client.polling(none_stop=True, interval=0)
  File "C:\Users\Дом\AppData\Local\Programs\Python\Python38\lib\site-packages\telebot\__init__.py", line 619, in polling
    self.__threaded_polling(none_stop, interval, timeout, long_polling_timeout, allowed_updates)
  File "C:\Users\Дом\AppData\Local\Programs\Python\Python38\lib\site-packages\telebot\__init__.py", line 678, in __threaded_polling
    raise e
  File "C:\Users\Дом\AppData\Local\Programs\Python\Python38\lib\site-packages\telebot\__init__.py", line 641, in __threaded_polling
    self.worker_pool.raise_exceptions()
  File "C:\Users\Дом\AppData\Local\Programs\Python\Python38\lib\site-packages\telebot\util.py", line 130, in raise_exceptions
    raise self.exception_info
  File "C:\Users\Дом\AppData\Local\Programs\Python\Python38\lib\site-packages\telebot\util.py", line 82, in run
    task(*args, **kwargs)
  File "main.py", line 139, in money_exit2
    api.pay(account=user_phone, amount=price, comment='Вывод денег из торогового бота')
  File "C:\Users\Дом\AppData\Local\Programs\Python\Python38\lib\site-packages\SimpleQIWI\Session.py", line 230, in pay
    data = response.json()
  File "C:\Users\Дом\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\models.py", line 910, in json
    return complexjson.loads(self.text, **kwargs)
  File "C:\Users\Дом\AppData\Local\Programs\Python\Python38\lib\json\__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "C:\Users\Дом\AppData\Local\Programs\Python\Python38\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\Дом\AppData\Local\Programs\Python\Python38\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)


What is the problem with transferring funds? The phone number is correct.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
ScriptKiddo, 2021-09-18
@ScriptKiddo

The problem is that you are not running the code that you show.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question