Skip to main content

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

Python Code linter: ruff Checked with mypy Linters

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

telegram_wallet_pay-0.0.5.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

telegram_wallet_pay-0.0.5-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file telegram_wallet_pay-0.0.5.tar.gz.

File metadata

  • Download URL: telegram_wallet_pay-0.0.5.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for telegram_wallet_pay-0.0.5.tar.gz
Algorithm Hash digest
SHA256 11281a80620c4b4c1b20cd4d9ff0e99d50fc57ad445ebd9b8890239de477b61c
MD5 b483090f19f9d85928c86373dc1fc8ed
BLAKE2b-256 713a91368433a83351ef71d4d0ccdd79d89cc0ed77f8bee23dbd34480857d939

See more details on using hashes here.

File details

Details for the file telegram_wallet_pay-0.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for telegram_wallet_pay-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 a35fb6f843b3554f4f332862ed3328e000d7548cf5ac5af573d80cbad802c615
MD5 79e2842cea4dac86dd4941be8afe69ca
BLAKE2b-256 e936c7f51c325e66f53bbbbf405980526290dfeff708d88fd740dfc805d1dc0e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page