Skip to content

Simple and convenient asynchronous library for working with the Business Lava API.

License

Notifications You must be signed in to change notification settings

kesevone/aiolava

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alt text

🅰️ Aiolava — a simple and convenient asynchronous library for working with the Business Lava API.

You will be able to create invoices with all the parameters that are available in the Lava API, as well as receive information about them after creation. Also, you can get information about the balance, and in the future, methods for the Payoff API, the Reccurent API will be implemented

⤵️ Installation (pip/git)

pip install pyaiolava
pip install git+https://github.com/kesevone/aiolava

📄 Simple usage

import asyncio

from pyaiolava import BusinessAiolava
from pyaiolava.models import NewInvoiceModel
from pyaiolava.utils.generators import generate_payment_id


SHOP_ID = 'YOUR_SHOP_ID'
API_KEY = 'YOUR_API_KEY'

lava = BusinessAiolava(
    api_key=API_KEY,
    shop_id=SHOP_ID
)
    
async def main() -> None:
    payment_id = generate_payment_id()
    new_invoice: NewInvoiceModel = await lava.create_invoice(
        payment_id=payment_id,
        amount=150,
        payment_methods=['sbp', 'card'],
        custom_data='Test Custom Data'
    )
    print(new_invoice)

if __name__ == '__main__':
    asyncio.run(main())

All data returned from the API is converted into a convenient Pydantic-model with clear parameter names.

⚡ TODO

  • Implement methods for Payoff API
  • Implement methods for Recurrent API

Thanks to REPTIS for providing Lava API tokens.

About

Simple and convenient asynchronous library for working with the Business Lava API.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages