Прием платежей и выплаты через 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.10.tar.gz
(4.0 kB
view details)
Built Distribution
File details
Details for the file mulenpay_api-1.0.10.tar.gz
.
File metadata
- Download URL: mulenpay_api-1.0.10.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 | a121f5b0c2aefd9cdb6bae99d8f0d9d9dfec45754612e70f495b33db5293ee47 |
|
MD5 | da93be83e26ba7f4bf6e9999f3bb1cc7 |
|
BLAKE2b-256 | 72bad261fdb190d618c2eb6cb530fba2b52af89e9f87419939d8a52f09b0f813 |
File details
Details for the file mulenpay_api-1.0.10-py3-none-any.whl
.
File metadata
- Download URL: mulenpay_api-1.0.10-py3-none-any.whl
- Upload date:
- Size: 5.1 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 | 12caee13e642afeef97a4b286d20995f0b228cf1d5aa3352f4b62073a8cd00f1 |
|
MD5 | 88ca6d0767052dfe07397b4df0fb3714 |
|
BLAKE2b-256 | c8237d4d5ac436c6a0292cb41d2b7c03d0f487157c9866994bc40791b59de64b |