Skip to main content

Asyncio client for PayOk API

Project description

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.

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

asyncio_payok-1.0.0.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

asyncio_payok-1.0.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file asyncio_payok-1.0.0.tar.gz.

File metadata

  • Download URL: asyncio_payok-1.0.0.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.6

File hashes

Hashes for asyncio_payok-1.0.0.tar.gz
Algorithm Hash digest
SHA256 4a408b8aac2897476e59b7c17d6e27ffa7669456c5bdd764802b1740318ebcf9
MD5 53393b66bfb3e450ca4cc0c56bbe78bb
BLAKE2b-256 82e542c7b146ef87757c03243fb4cd309d0c6ea6833e1170920ec3635dc0d9fc

See more details on using hashes here.

File details

Details for the file asyncio_payok-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for asyncio_payok-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1eb72fea4a85826c92fa94916905c642216d1f7cbfdd0c09455cb49a884fc65f
MD5 324ba0217e2bca0737ca1ba2e9376a70
BLAKE2b-256 273876fc899b0caf3b0928ab73636632284f2c8e1b7f1c2ab01cac3f073606b6

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