Async client for Telegram Wallet Pay API
Project description
Telegram Wallet Pay
Python async client for Telegram Wallet Pay API made of aiohttp
and pydantic
Get started
Read Telegram Wallet Pay API docs
https://docs.wallet.tg/pay/#section/Get-started
Install our library
pip install telegram-wallet-pay
Create order
import asyncio
import os
from uuid import uuid4
from telegram_wallet_pay import TelegramWalletPay
# use your token from wallet pay
TOKEN = os.getenv("TELEGRAM_WALLET_PAY_TOKEN")
async def main():
# create API-client instance
wallet = TelegramWalletPay(TOKEN)
# create your first order
result = await wallet.create_order(
amount=40,
currency_code="RUB",
description="Test Payment",
external_id=str(uuid4()),
timeout_seconds=5 * 60,
customer_telegram_user_id=66812456,
)
# let's print creation result
print("Result:", result)
print("Order:", result.data)
# also you can update order status via `get_preview` method
result = await wallet.get_preview(result.data.id)
print("Updated Order Preview:", result.data)
# don't forget close API-client instance on your app shutdown
await wallet.close()
if __name__ == "__main__":
asyncio.run(main())
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
Built Distribution
Close
Hashes for telegram_wallet_pay-0.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 683cdd54df735193a041502fa8bb3c10664344dc7237ba3a9651be52ac41d1a1 |
|
MD5 | 056032ecd27547ad764a432a1ae9ef3e |
|
BLAKE2b-256 | a9ae35c7d812dfa3ad658fdc65484a335d1bb63c6918dcf18cef7e5b26a415f9 |
Close
Hashes for telegram_wallet_pay-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0216357a72262e95fdfd01c2ae3e28709c00fe7f89c9e8ec0ea23efeaadb64f8 |
|
MD5 | b96ce36c1bc1f0724e32296087bae76f |
|
BLAKE2b-256 | 98cb05f40c185e996ded853c1e667d5f1ff0645e6c1d5c81f046dda55ca6fa11 |