1# Здесь представлен пример без контекста async with
2import asyncio
3
4from glQiwiApi import QiwiWrapper
5
6# Создаем объект кошелька и обязательно передаем without_context = True,
7# иначе будут проблемы с aiohttp.ClientSession
8wallet = QiwiWrapper(
9 api_access_token='token',
10 phone_number="+number",
11 secret_p2p="your secret p2p",
12 without_context=True
13)
14
15
16async def main():
17 bill = await wallet.create_p2p_bill(amount=1)
18 # new version
19 new_status = await bill.paid
20 # old version
21 old_status = (await wallet.check_p2p_bill_status(bill.bill_id)) == 'PAID'
22 assert new_status == old_status
23
24
25asyncio.run(main())