Skip to main content

mongolian-payment-pass

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

Installation

pip install mongolian-payment-pass

Usage

Synchronous

from mongolian_payment_pass import PassClient, PassConfig

client = PassClient(PassConfig(
    endpoint="https://api.pass.mn",
    ecommerce_token="your_token",
    callback="https://example.com/callback",
))

# Create a new order (amount is multiplied by 100 automatically)
result = client.create_order(1500)
print(result.order_id)
print(result.shop)

# Create order with callback query params
result = client.create_order(1500, callback_params={"ref": "order-123"})

# Check order status
status = client.inquiry_order(result.order_id)
print(status.status)       # "paid", "pending", "cancelled", "voided"
print(status.resp_code)

# Notify a phone number about an order
client.notify_order(result.order_id, "99112233")

# Cancel an order
client.cancel_order(result.order_id)

# Void an order
client.void_order(result.order_id)

Asynchronous

import asyncio
from mongolian_payment_pass import AsyncPassClient, PassConfig

async def main():
    async with AsyncPassClient(PassConfig(
        endpoint="https://api.pass.mn",
        ecommerce_token="your_token",
        callback="https://example.com/callback",
    )) as client:
        result = await client.create_order(1500)
        status = await client.inquiry_order(result.order_id)
        print(status.status)

asyncio.run(main())

Webhook Parsing

from mongolian_payment_pass import PassClient

# Parse incoming webhook payload (works as a static method)
webhook = PassClient.parse_webhook(request_body)
print(webhook.order_id)
print(webhook.operation)   # "payment" or "void"
print(webhook.is_success)

Configuration from Environment Variables

from mongolian_payment_pass import PassClient, load_config_from_env

client = PassClient(load_config_from_env())

Required environment variables:

Variable Description
PASS_ENDPOINT Pass API base URL
PASS_ECOMMERCE_TOKEN E-commerce token for authentication
PASS_CALLBACK Callback URL for order notifications

Status Constants

from mongolian_payment_pass import (
    OrderInquiryStatusPaid,       # "paid"
    OrderInquiryStatusPending,    # "pending"
    OrderInquiryStatusCancelled,  # "cancelled"
    OrderInquiryStatusVoided,     # "voided"
    WebhookOperationPayment,      # "payment"
    WebhookOperationVoid,         # "void"
)

License

MIT

Metadata

Release files for mongolian-payment-pass 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-pass 1.0.0
File Size Uploaded Provenance Actions
mongolian_payment_pass-1.0.0.tar.gz 10.3 kB Without provenance Details for mongolian_payment_pass-1.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 19.8 kB

Release files / mongolian_payment_pass-1.0.0.tar.gz

Download URL mongolian_payment_pass-1.0.0.tar.gz
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
121b1f2abf30a19b88a889eae91a1e3eee56e9b896efbad75dbc0188c01178c5
BLAKE2b-256 checksum
How to use checksums
3db4b3b88548dcd0603ab7fe87a6b004d74915cd847ada56bfdece301d81681b
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_pass-1.0.0-py3-none-any.whl

Download URL mongolian_payment_pass-1.0.0-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
743c1c0e96db9816ee5c4a9bcf6c0c263332358278a16de3bbc9df971ad8ab26
BLAKE2b-256 checksum
How to use checksums
f69b7615f1a0cf79c9accd946a239d6bf3e5e7bea8e20aecdcde65735179739c
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-pass 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