Skip to main content

SePay Payment Gateway SDK for Python

Official Python library for integrating SePay Payment Gateway.

Installation

Install using pip:

pip install sepay-pg

Quick Start

Initialize Client

from sepay_pg import SePayClient

sepay = SePayClient(
    merchant_id="YOUR_MERCHANT_ID",
    secret_key="YOUR_MERCHANT_SECRET_KEY",
    env="sandbox" # or "production"
)

Generate Checkout Parameters

order_data = {
    'order_invoice_number': 'INV-123456',
    'order_amount': 100000, # 100,000 VND
    'order_description': 'Test payment description',
    'success_url': 'https://yourwebsite.com/payment/success',
    'error_url': 'https://yourwebsite.com/payment/error',
    'cancel_url': 'https://yourwebsite.com/payment/cancel'
}

checkout_fields = sepay.generate_checkout_data(order_data)

# Resulting dictionary contains all required fields including merchant and signature:
# print(checkout_fields['signature'])

Verify Webhook IPN Signature

# Verify signature header from SePay webhook post request
is_valid = sepay.verify_webhook_signature(
    signature_header=request.headers.get('x-sepay-signature'),
    raw_payload=request.data # raw request body bytes
)

API Queries

# Get order details
order = sepay.get_order("INV-123456")

# Get transactions history
transactions = sepay.get_transactions({"limit": 10})

License

This project is licensed under the MIT License.

Metadata

Release files for sepay-pg 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 sepay-pg 1.0.0
File Size Uploaded Provenance Actions
sepay_pg-1.0.0.tar.gz 4.9 kB Without provenance Details for sepay_pg-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sepay-pg 1.0.0
File Interpreter ABI Platform Actions
sepay_pg-1.0.0-py3-none-any.whl Python 3 none any Details for sepay_pg-1.0.0-py3-none-any.whl

Total release size: 10.2 kB

Release files / sepay_pg-1.0.0.tar.gz

Download URL sepay_pg-1.0.0.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
68774c9e282d8f9fffa6d774106622073ce3eecbc4b41fa438cb1916f3be8783
BLAKE2b-256 checksum
How to use checksums
c3ae851a437230b3a6340f395de79473e088b9a0f02b20c993112a83af81a710
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

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

Download URL sepay_pg-1.0.0-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
62cc67d49c6d1fbdee7a5ed0215f6fa3cb36e5c0b7b2776554236dc66c11ff74
BLAKE2b-256 checksum
How to use checksums
e6f83c63dfaf5b0fee427f56ae14d1c8140093809d6bb23776be74e32e95128f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Security for sepay-pg 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