Paystation
Python client for PayStation payment APIs.
Features
- Initialize payments through PayStation
- Check transaction status by invoice number
- Supports sandbox and production environments
- Simple request/response flow with JSON responses
Requirements
- Python 3.10+
requests>=2.32.5
Installation
From PyPI:
pip install paystation
From source:
git clone https://github.com/rozari0/paystation.git
cd paystation
pip install .
Quick Start (Sandbox)
Use the following sandbox credentials:
- Merchant ID:
104-1653730183 - Password:
gamecoderstorepass
from paystation import PayStation
client = PayStation(
merchant_id="104-1653730183",
password="gamecoderstorepass",
sandbox=True,
)
response = client.initiate_payment(
invoice_number="INV-1001",
payment_amount=100.0,
cust_name="John Doe",
cust_phone="01700000000",
cust_email="john@example.com",
callback_url="https://your-domain.com/paystation/callback",
)
print(response)
Environments
sandbox=True uses https://sandbox.paystation.com.bd.
sandbox=False uses https://api.paystation.com.bd.
API Reference
PayStation(merchant_id, password, sandbox=False)
Create a PayStation client instance.
merchant_id(str): PayStation merchant IDpassword(str): PayStation passwordsandbox(bool): SetTruefor sandbox
initiate_payment(...)
Initiates a payment.
Required parameters:
invoice_number(str): Unique invoice IDpayment_amount(float): Amount to be paidcust_name(str): Customer namecust_phone(str): Customer phonecust_email(str): Customer emailcallback_url(str): URL for payment callback/result
Optional parameters:
currency(str, default:"BDT")reference(str | None)cust_address(str | None)checkout_items(str | dict | None)pay_with_charge(bool, default:False)emi(bool, default:False)opt_a(str | dict | None)opt_b(str | dict | None)opt_c(str | dict | None)
Returns:
dict: Parsed JSON response from PayStation
Example with optional fields:
response = client.initiate_payment(
invoice_number="INV-1002",
payment_amount=250.0,
cust_name="Jane Doe",
cust_phone="01800000000",
cust_email="jane@example.com",
callback_url="https://your-domain.com/paystation/callback",
currency="BDT",
reference="ORDER-2026-0001",
cust_address="Dhaka, Bangladesh",
checkout_items={"item": "Premium Plan", "qty": 1},
pay_with_charge=True,
emi=True,
opt_a={"source": "web"},
)
get_transaction_status_by_invoice(invoice_number)
Checks transaction status for an invoice.
invoice_number(str): Invoice used during payment initiation
Returns:
dict: Parsed JSON response from PayStation
status = client.get_transaction_status_by_invoice("INV-1001")
print(status)
Typical Callback Flow
- You call
initiate_paymentand get a response from PayStation. - The customer completes payment on the PayStation page.
- PayStation sends the result to your
callback_url. - You verify final status by calling
get_transaction_status_by_invoice.
Notes
- The client returns
response.json()directly. - Add your own handling for timeouts, connection errors, and invalid JSON.
- Keep production credentials private.
License
This project is licensed under the MIT License. See LICENSE.
Metadata
Release files for paystation 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| paystation-1.1.0.tar.gz | 3.6 kB | With provenance | Details for paystation-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| paystation-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for paystation-1.1.0-py3-none-any.whl |
Total release size: 8.2 kB
Release files / paystation-1.1.0.tar.gz
| Download URL | paystation-1.1.0.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9925778205b227aa55353b53a60499ec366b8bc88e88b5231c925da2210d3c2e
|
|
BLAKE2b-256 checksum How to use checksums |
195db86eb8c0409c2a5054735d4e7190444dafdf108a0639ed838182896be30e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 14, 2026.
Transparency logRelease files / paystation-1.1.0-py3-none-any.whl
| Download URL | paystation-1.1.0-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3ed2e67d14256f0408c9f414effcdfce5786e24abdd5e090243d0e1845b3884e
|
|
BLAKE2b-256 checksum How to use checksums |
b7f041bdf198a69fb2016b07253693a6a5a0b5b352e3f5a136aa49e0a603c28c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 14, 2026.
Transparency logSecurity for paystation 1.1.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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for paystation-1.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 14, 2026.
Transparency logA 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.