Прием платежей и выплаты через Mulen Pay
Project description
MulenPay API Client
Описание
Асинхронный Python-клиент для работы с API MulenPay. Подходит для управления платежами и подписками.
Установка
pip install pydantic==2.9.2
pip install httpx==0.27.2
pip install mulenpay-api
Использование Настройка клиента Для начала работы создайте экземпляр Payment или Subscribe, указав ваш api_key и secret_key.
from mulenpay_api import Payment
from mulenpay_api.subscribe import Subscribe
api_key = 'ВАШ_API_KEY'
secret_key = 'ВАШ_SECRET_KEY'
payment = Payment(api_key=api_key, secret_key=secret_key)
subscribe = Subscribe(api_key=api_key)
Работа с платежами
Создание платежа
import asyncio
async def create_payment():
response = await payment.create_payment(payment.CreatePayment(
currency="rub",
amount="1000.50",
uuid="invoice_123",
shopId=5,
description="Покупка булочек",
subscribe=None,
holdTime=None
))
print(response)
if __name__ == '__main__':
asyncio.run(create_payment())
Получение списка платежей
async def get_list():
response = await payment.get_payment_list()
print(response)
if __name__ == '__main__':
asyncio.run(get_list())
Получение платежа по ID
async def get_by_id():
response = await payment.get_payment_by_id(5)
print(response)
if __name__ == '__main__':
asyncio.run(get_by_id())
Подтверждение платежа
async def confirm_payment():
response = await payment.confirm_payment(5)
print(response)
if __name__ == '__main__':
asyncio.run(confirm_payment())
Отмена платежа
async def cancel_payment():
response = await payment.cancel_payment(5)
print(response)
if __name__ == '__main__':
asyncio.run(cancel_payment())
Возврат платежа
async def refund_payment():
response = await payment.refund_payment(5)
print(response)
if __name__ == '__main__':
asyncio.run(refund_payment())
Работа с подписками
Получение списка подписок
async def get_subscription_list():
response = await subscribe.get_subscription_list()
print(response)
if __name__ == '__main__':
asyncio.run(get_subscription_list())
Удаление подписки по ID
async def delete_subscription():
response = await subscribe.delete_subscription_by_id(5)
print(response)
if __name__ == '__main__':
asyncio.run(delete_subscription())
Требования
-Python 3.7+
-Установленная библиотека mulenpay-api
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mulenpay_api-1.0.11.tar.gz
(4.0 kB
view details)
Built Distribution
File details
Details for the file mulenpay_api-1.0.11.tar.gz
.
File metadata
- Download URL: mulenpay_api-1.0.11.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2801187753fb0edfe5357930f8de94e038cb71457c569ccece33e2d4fb67b03e |
|
MD5 | d3495b69666e02474f9c87dfca7eb3bb |
|
BLAKE2b-256 | 8a5dd8bd75dede7317f3d6c8293250eb5a7a51ed2279ea8504b60c3b720a7034 |
File details
Details for the file mulenpay_api-1.0.11-py3-none-any.whl
.
File metadata
- Download URL: mulenpay_api-1.0.11-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ecbd7664d63007f94f1a80de98cd93e8bab390aa51517c1510d4fbf91ad3ccf |
|
MD5 | d86b1b544175d02d00402540a7d80fa2 |
|
BLAKE2b-256 | 72f7bbcb372bb1bc9a990f2489d0b3b8bf8d8756a7dfe3e603b1b5020ba2b6b7 |