asyncio-payok

Asyncio client for PayOk API


Install
pip install asyncio-payok==1.0.0

Documentation

asyncio_payok

Quickstart

Here's a quick example of using asyncio_payok to get your current balance:

import asyncio
from asyncio_payok import PayOk

async def main():
    client = PayOk('your_api_id', 'your_api_key', 'your_secret_key', 'your_shop_id')
    balance = await client.get_balance()
    print(balance)

asyncio.run(main())

Features

  • Asynchronous requests
  • Easy to use with Python's asyncio
  • Support for payment creation, balance checks, transaction retrieval, and payouts

Usage

Initializing the Client

Create an instance of the PayOk client with your API credentials:

from asyncio_payok import PayOk

client = PayOk(api_id='your_api_id', api_key='your_api_key', secret_key='your_secret_key', shop='your_shop_id')

Get Balance

Retrieve your current balance as follows:

balance = await client.get_balance()

Create Payment

Initiate a payment with the required details:

payment = await client.create_payment(amount='10.00', currency='USD', description='Payment Description', ...)

Transaction History

Fetch the transaction history by payment ID or offset:

transactions = await client.get_transactions(payment_id='123', offset=10)

Create Payout

Send a payout to a specified recipient:

payout = await client.create_payout(amount='10.00', receiver='receiver_info', ...)

Handling Exceptions

Handle API and network exceptions gracefully:

try:
    balance = await client.get_balance()
except Exception as e:
    print(f'Error occurred: {e}')

Dependencies

  • Python 3.6 or higher
  • aiohttp

Contributing

Contributions are welcome! Please open a pull request or issue to propose changes or additions.

License

This project is licensed under the MIT License.