Skip to main content

IOKA Asynchronous Python Client Library

Project description

IOKA Asynchronous Python Client Library

Python Package Index

Клиент для платежного сервиса IOKA. Позволяет обращаться к API IOKA из кода на Python.

Установка

pip install ioka

Требования

Python 3.7+

Использование

from ioka import IOKA
ioka_client = IOKA('IOKA_SECRET_KEY', 'IOKA_HOST')
  • При создании клиента задаются параметры: Secret Key и IOKA Host:

    SECRET_KEY: для аутентификации.

    IOKA_HOST: для выбора среды (тестовый Host & боевой Host).

Обращение к API осуществляется через методы клиента.

Регистрация платежа (описание)
from ioka.schemas import RegisterPaymentRequest

data = {
    "amount": 3000,
    "currency": 398,
    "order_id": 322,
    "client_id": 1247,
    "tr_type": 0,
    "email": "client.1247@gmail.com",
    "phone": "+7**********",
    "back_url": f"https://mywebsite.com/back/",
    "callback_url": "https://mywebsite.com/callback/"
}

payment = RegisterPaymentRequest(**data)
ioka_response = await ioka_client.register_payment(payment)

В случае успеха возвращает строку типа URL.

TODO:

  • Validations

  • Error response

  • Async to sync

  • Signature verification method

  • Implement rest-aiohttp in more smart way

  • Update README, add another methods

  • Document methods

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

ioka-1.1.3.tar.gz (3.9 kB view hashes)

Uploaded source

Built Distribution

ioka-1.1.3-py2.py3-none-any.whl (6.2 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page