Skip to content

kewldan/AAIO

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AAIO API for Python 3

About

This library is a wrapper for the https://aaio.so API from enthusiasts. All methods are described and all types are explicitly defined. Methods that create requests to aaio.so return a pydantic's models for each response. Please write about all problems related to the library to issues

API is up-to-date as of 06 September 2024.

Features

  • It's completely asynchronous
  • You can use multiple clients to work with multiple users or shops
  • All methods for working with API are implemented
  • The library returns strictly typed for responses from APIs
  • For each method, docstrings are used
  • The library handle {type: error} responses and throws AAIOBadRequest exception
  • Our library was the first to be added to the official AAIO wiki
  • Modern, strict code for Python 3.7

Library Installation

  • Install via pip: pip install aaio
  • Download sources - git clone https://github.com/kewldan/AAIO

Getting Started

Get user balance

import asyncio

from aaio import AAIO


async def main():
    client = AAIO('MERCHANT ID', 'SECRET KEY', 'API KEY')
    balances = await client.get_balances()
    print(balances)  # type='success' code=None message=None balance=625.85 referral=172.96 hold=0.0


asyncio.run(main())

Create payment URL for customer

import asyncio

from aaio import AAIO


async def main():
    client = AAIO('MERCHANT ID', 'SECRET KEY', api_key='API KEY')
    
    
    # New way to create payments
    payment_url = await client.get_pay_url(100, 'my_order_id', 'My order description', 'qiwi', '[email protected]',
                                        'referral code', currency='USD',
                                        language='en')
    print(payment_url)  # Prints payment url for customer
    
    
    # DEPRECATED METHOD
    payment_url = client.create_payment(100, 'my_order_id', 'My order description', 'qiwi', '[email protected]',
                                        'referral code', currency='USD',
                                        language='en')
    print(payment_url)
    ###################


asyncio.run(main())

Create payoff

import asyncio

from aaio import AAIO


async def main():
    client = AAIO('MERCHANT ID', 'SECRET KEY', api_key='API KEY')
    payoff = await client.create_payoff('qiwi', 100.35, '79998887766', 'my_payoff_id')
    print(payoff.status)  # in_progress


asyncio.run(main())

Contact

License

Released under MIT by @kewldan.