Skip to main content

mongolian-payment-mongolchat

MongolChat payment gateway SDK for Python. Supports both synchronous and asynchronous usage.

Installation

pip install mongolian-payment-mongolchat

Usage

Synchronous

from mongolian_payment_mongolchat import MongolChatClient, MongolChatConfig, MchatGenerateQrInput, MchatProduct

client = MongolChatClient(MongolChatConfig(
    endpoint="https://api.mongolchat.mn",
    api_key="your_api_key",
    worker_key="your_worker_key",
    app_secret="your_app_secret",
    branch_no="001",
))

# Generate a QR code
qr = client.generate_qr(MchatGenerateQrInput(
    amount=5000,
    products=[MchatProduct(product_name="Coffee", quantity="1", price=5000, tag="food")],
    title="Coffee Shop",
    sub_title="Order #123",
    noat="123456",
    nhat="654321",
    ttd="789",
    reference_number="REF-001",
    expire_time="2026-12-31T23:59:59",
))

print(qr.qr)  # QR code string

# Check QR payment status
status = client.check_qr(qr.qr)
print(status.status)

Asynchronous

import asyncio
from mongolian_payment_mongolchat import AsyncMongolChatClient, MongolChatConfig, MchatGenerateQrInput, MchatProduct

async def main():
    async with AsyncMongolChatClient(MongolChatConfig(
        endpoint="https://api.mongolchat.mn",
        api_key="your_api_key",
        worker_key="your_worker_key",
        app_secret="your_app_secret",
        branch_no="001",
    )) as client:
        qr = await client.generate_qr(MchatGenerateQrInput(
            amount=5000,
            products=[MchatProduct(product_name="Coffee", quantity="1", price=5000, tag="food")],
            title="Coffee Shop",
            sub_title="Order #123",
            noat="123456",
            nhat="654321",
            ttd="789",
            reference_number="REF-001",
            expire_time="2026-12-31T23:59:59",
        ))

        status = await client.check_qr(qr.qr)
        print(status.status)

asyncio.run(main())

Configuration from Environment Variables

from mongolian_payment_mongolchat import MongolChatClient, load_config_from_env

client = MongolChatClient(load_config_from_env())

Required environment variables:

Variable Description
MONGOLCHAT_ENDPOINT MongolChat API base URL
MONGOLCHAT_API_KEY API key for the api-key header
MONGOLCHAT_WORKER_KEY Worker key for Authorization: WorkerKey header
MONGOLCHAT_APP_SECRET Application secret
MONGOLCHAT_BRANCH_NO Branch number

License

MIT

Metadata

Release files for mongolian-payment-mongolchat 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mongolian-payment-mongolchat 1.0.0
File Size Uploaded Provenance Actions
mongolian_payment_mongolchat-1.0.0.tar.gz 7.5 kB Without provenance Details for mongolian_payment_mongolchat-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mongolian-payment-mongolchat 1.0.0
File Interpreter ABI Platform Actions
mongolian_payment_mongolchat-1.0.0-py3-none-any.whl Python 3 none any Details for mongolian_payment_mongolchat-1.0.0-py3-none-any.whl

Total release size: 15.0 kB

Release files / mongolian_payment_mongolchat-1.0.0.tar.gz

Download URL mongolian_payment_mongolchat-1.0.0.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
555f58341428169e5d2a30a736ec6b1ef1aad44042c5bea25e26a4c34a9eb1a0
BLAKE2b-256 checksum
How to use checksums
0fafc3b362e38f5f6de4536df927f39c3121b8ba2e89072e94c713a3dc378869
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.13

Release files / mongolian_payment_mongolchat-1.0.0-py3-none-any.whl

Download URL mongolian_payment_mongolchat-1.0.0-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
905e49ac0c9756ea375a2835c07ae736d53205f7d8cf86f9a9eafaf2f8d83e26
BLAKE2b-256 checksum
How to use checksums
47a2413bc1ee61bc5e25c5743b89abd11ee02f108ce4244bc094eadf9c542228
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.13

Security for mongolian-payment-mongolchat 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page