Install package with pip:
pip install pyeasypay
or
python3 -m pip install pyeasypay
Example on creating invoice and waiting for it to be paid:
from asyncio import run, sleep
from pyeasypay import EasyPay, Provider
async def main():
cryptobot = Provider(name='cryptobot', api_key='')
crystalpay = Provider(name='crystalpay', login='', secret='')
pay = EasyPay(providers=[cryptobot, crystalpay])
invoice = await pay.create_invoice(15, 'RUB', 'cryptobot')
print(f"Invoice URL: {invoice.pay_info}")
while invoice.status != 'paid':
await sleep(5)
await invoice.check()
if invoice.status == 'paid':
print('Invoice paid! 🎉')
if __name__ == '__main__':
run(main())
List of supported providers:
Provider | Status | Kwargs for Proiver (* is required) |
---|---|---|
CryptoBot | ✅ | api_key *, network |
CrystalPay | ✅ | login *, secret * |
AAIO | WIP |
Contributions are welcomed!