Skip to main content

No project description provided

Project description

WalletPay API Client

A Python client for interacting with the WalletPay API.

Installation

Install the package using pip:

pip install WalletPay

Usage

Synchronous Client

from WalletPay import WalletPayAPI

# Initialize the API client
api = WalletPayAPI(api_key="YOUR_API_KEY")

# Create an order
order = api.create_order(
    amount=100,
    currency_code="USD",
    description="Test Order",
    external_id="12345",
    timeout_seconds=3600,
    customer_telegram_user_id="telegram_user_id"
)

# Get order preview
order_preview = api.get_order_preview(order_id="ORDER_ID")

# Check if the order is paid
if order_preview.status == "PAID":
    print("Order has been paid!")
else:
    print("Order is not paid yet.")

# Get order list
orders = api.get_order_list(offset=0, count=10)

# Get order amount
amount = api.get_order_amount()

Asynchronous Client

To work with the asynchronous client, you'll need an async environment, such as asyncio.

import asyncio
from WalletPay import AsyncWalletPayAPI

async def main():
    # Initialize the async API client
    api = AsyncWalletPayAPI(api_key="YOUR_API_KEY")

    # Create an order
    order = await api.create_order(
        amount=100,
        currency_code="USD",
        description="Test Order",
        external_id="12345",
        timeout_seconds=3600,
        customer_telegram_user_id="telegram_user_id"
    )

    # Get order preview
    order_preview = await api.get_order_preview(order_id="ORDER_ID")
    
    # Check if the order is paid
    if order_preview.status == "PAID":
        print("Order has been paid!")
    else:
        print("Order is not paid yet.")
    
    # Get order list
    orders = await api.get_order_list(offset=0, count=10)

    # Get order amount
    amount = await api.get_order_amount()

# Run the async function
asyncio.run(main())

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Contact

For any questions or feedback, please reach out to @xdownedx on Telegram.

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

WalletPay-1.1.2.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

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

WalletPay-1.1.2-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file WalletPay-1.1.2.tar.gz.

File metadata

  • Download URL: WalletPay-1.1.2.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.0

File hashes

Hashes for WalletPay-1.1.2.tar.gz
Algorithm Hash digest
SHA256 47e11e1dd03d4c6d3a02df1c3107ffffba6ddd23751a6f4ea7c53bd5b55c71e6
MD5 656ab05d3f893f10dd3e37fcf9dbf837
BLAKE2b-256 890029614e6d7a067d556dc8b8507ef1c6c492415174c05d8d21e7e4344de4d1

See more details on using hashes here.

File details

Details for the file WalletPay-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: WalletPay-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.0

File hashes

Hashes for WalletPay-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e660701969c1bb58020c083835075fb2209570aa40ed7e104f55e5606bab1cc6
MD5 b90d4047bd5688af1f951618d776a650
BLAKE2b-256 d5e965f13909abe624c6ca3e12e1e476b0b1367ae679c213c61e0d3ff14c76c3

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