Skip to main content

Async AAIO api wrapper for python

Project description

AAIO API for Python 3

About

This library is a wrapper for the https://aaio.so API from enthusiast. 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 16 August 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')
    
    
    # New way to create payments
    payment_url = await client.get_pay_url(100, 'my_order_id', 'My order description', 'qiwi', 'support@aaio.so',
                                        'referral code', currency='USD',
                                        language='en')
    print(payment_url['url'])  # Prints payment url for customer
    
    
    # DEPRECATED METHOD
    payment_url = client.create_payment(100, 'my_order_id', 'My order description', 'qiwi', 'support@aaio.so',
                                        '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')
    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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aaio-1.4.1.tar.gz (87.1 kB view details)

Uploaded Source

Built Distribution

aaio-1.4.1-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file aaio-1.4.1.tar.gz.

File metadata

  • Download URL: aaio-1.4.1.tar.gz
  • Upload date:
  • Size: 87.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for aaio-1.4.1.tar.gz
Algorithm Hash digest
SHA256 5d9f5cac325f53d5ef17afdf68eae58b17746a7f7f2117fdb6ec1454e6b8b26c
MD5 ed13e2acd6472e84bd3534a0b4863360
BLAKE2b-256 d27bbc150c57bc2074d0bc1ad61174552469b10d05a7c4357d0020c5fac92922

See more details on using hashes here.

File details

Details for the file aaio-1.4.1-py3-none-any.whl.

File metadata

  • Download URL: aaio-1.4.1-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for aaio-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bec668d2222e538774feeb72bb619f0b1ed55a64763b84fd68a99c499ef36e33
MD5 383c5cca5c239a7eb538cfc1b5c4333f
BLAKE2b-256 e75a75dc847f943176e05d49e1773e4b48f7ced8e9fc397443e0c5c336362034

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page