Skip to main content

Asynchronous AnyPay API wrapper

Project description

Search4FacesAPI

PyPI PyPI

A simple, yet powerful library for AnyPay API

Usage

With AnyPayAPI you can easily create and retrieve payment and payout info, get informaition about your account's balance and commissions, etc.

Documentation

Official docs can be found on the API's webpage

Installation

pip install anypay

Requirements

  • Python 3.9+
  • httpx
  • pydantic

Features

  • Asynchronous
  • Exception handling
  • Pydantic return model
  • LightWeight

Basic example

import asyncio

from anypay import AnyPayAPI, AnyPayAPIError


api = AnyPayAPI(
    'api_id', 'api_key', no_check=True # you can disable credentials check
) 


async def main():

    try:

        await api.get_balance()

    except AnyPayAPIError as exc:

        print(exc)

    payments = await api.get_payments(project_id=1) # project_id can be provided in __init__
    print(payments[0].id, payments[0].status)

    bill = await api.create_payment(
        pay_id=1234,
        project_id=1,
        method='qiwi',
        email='test@mail.ru',
        amount=100, 
        currency='RUB', 
        description='Test payment', 
    )
    print(bill.id, bill.url)


asyncio.run(main())

Developed by Nikita Minaev (c) 2023

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

anypay-1.0.0.tar.gz (7.0 kB view hashes)

Uploaded Source

Built Distribution

anypay-1.0.0-py3-none-any.whl (7.5 kB view hashes)

Uploaded Python 3

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