Payok API Client
Python асинхронный клиент для взаимодействия с Payok API. Позволяет получать баланс, транзакции и создавать платежные формы.
Установка
pip install payok-aio
Примеры использования
import asyncio
from payok_aio import Payok
# Замените на реальные значения своих API ID и API Key
api_id = 123456
api_key = "your_api_key"
# Создаем экземпляр класса Payok
payok_instance = Payok(api_id=api_id, api_key=api_key)
async def main():
# Получаем баланс
balance_result = await payok_instance.get_balance()
if balance_result:
print(f"Баланс: {balance_result.balance}, Реф. баланс: {balance_result.ref_balance}")
else:
print("Не удалось получить баланс.")
# Получаем транзакции
transactions_result = await payok_instance.get_transactions()
if transactions_result:
if isinstance(transactions_result, list):
for transaction in transactions_result:
print(f"Транзакция {transaction.transaction_id}: {transaction.amount} {transaction.currency}")
else:
print(f"Транзакция {transactions_result.transaction_id}: {transactions_result.amount} {transactions_result.currency}")
else:
print("Не удалось получить транзакции.")
# Создаем платеж
payment_url = await payok_instance.create_pay(
amount=100.0,
payment="order123",
currency="RUB",
desc="Оплата заказа",
email="buyer@example.com",
success_url="https://example.com/success",
method="card",
lang="RU",
custom="custom_data"
)
if payment_url:
print(f"Ссылка для оплаты: {payment_url}")
else:
print("Не удалось создать платеж.")
if __name__ == '__main__':
asyncio.run(main())
Документация
Подробную документацию по API можно найти здесь.
Лицензия
Этот проект лицензирован по лицензии GNU GPLv3 - см. файл LICENSE для подробностей.
Замените your_api_key, your_api_id и другие данные в соответствии с вашими реальными значениями. Этот README.md содержит простой пример использования и может быть дополнен дополнительной информацией в зависимости от ваших потребностей.
Metadata
Release files for payok-aio 0.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| payok_aio-0.1.7.tar.gz | 18.8 kB | Without provenance | Details for payok_aio-0.1.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| payok_aio-0.1.7-py3-none-any.whl | Python 3 | none | any | Details for payok_aio-0.1.7-py3-none-any.whl |
Total release size: 39.2 kB
Release files / payok_aio-0.1.7.tar.gz
| Download URL | payok_aio-0.1.7.tar.gz |
|---|---|
| Size | 18.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
db5c55c28d305f19e874801042b95f5c04223fde6a70b2745f3de1c5b58bd1a6
|
|
BLAKE2b-256 checksum How to use checksums |
3167df34d55a2ebcf59e859aad656ce023d467c463aa1fecfddacc100d532464
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.9.19
|
Release files / payok_aio-0.1.7-py3-none-any.whl
| Download URL | payok_aio-0.1.7-py3-none-any.whl |
|---|---|
| Size | 20.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4212a3a27560bdb32110d21c8c9906b0c85409516a2f2687e806574e087eb1eb
|
|
BLAKE2b-256 checksum How to use checksums |
620929b43f0c5c66571922a94c8701a81e067870f5da9d1730d30677e595df98
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.9.19
|
Security for payok-aio 0.1.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.