OrcusPay Python SDK
Official Python client for the OrcusPay API.
Install
pip install orcuspay
Quick Start
from orcuspay import OrcusPay
client = OrcusPay(
access_key="ak_test_xxxxx",
secret_key="sk_test_xxxxx",
)
# Create a checkout session
session = client.create_checkout_session({
"success_url": "https://yoursite.com/success?session={CHECKOUT_SESSION_ID}",
"cancel_url": "https://yoursite.com/cancel",
"line_items": [
{
"quantity": 1,
"price_data": {
"unit_amount": 50000, # 500.00 BDT in paisa
"product_data": {"name": "Premium Plan"},
},
}
],
"currency": "BDT",
"customer": {
"name": "Test Customer",
"email": "customer@example.com",
"phone": "01700000000",
},
})
# Redirect customer to session["url"]
print(session["url"])
Retrieve a Checkout Session
session = client.get_checkout_session("pay_abc123")
print(session["payment_status"]) # SUCCEEDED | PENDING | FAILED
List Payments
payments = client.list_payments(limit=10, status="SUCCEEDED")
for payment in payments["payments"]:
print(payment["id"], payment["amount"])
Create a Payment Link
link = client.create_payment_link({
"title": "Donation",
"amount": 500,
"is_reusable": True,
"success_url": "https://yoursite.com/thanks",
})
print(link["url"])
Error Handling
from orcuspay import OrcusPay, OrcusPayError
try:
payment = client.get_payment("invalid_id")
except OrcusPayError as e:
print(e.code) # "not_found"
print(e.message) # "Payment not found" (str(e))
print(e.status) # 404
Available Methods
create_checkout_session(params)— Create a hosted checkout pageget_checkout_session(id)— Retrieve a checkout sessionlist_payments(limit?, cursor?, status?)— List payments with paginationget_payment(id)— Retrieve a single paymentlist_payment_links(limit?, cursor?)— List payment linkscreate_payment_link(params)— Create a payment linkget_payment_link(id)— Retrieve a payment linkstatus()— Check API status
Custom API URL
For self-hosted OrcusPay instances:
client = OrcusPay(
access_key="ak_prod_xxxxx",
secret_key="sk_prod_xxxxx",
api_url="https://your-instance.com/api/v1",
)
Requirements
- Python 3.9+
requestslibrary
License
MIT
Metadata
Release files for orcuspay 1.0.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 |
|---|---|---|---|---|
| orcuspay-1.0.0.tar.gz | 4.3 kB | Without provenance | Details for orcuspay-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| orcuspay-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for orcuspay-1.0.0-py3-none-any.whl |
Total release size: 9.1 kB
Release files / orcuspay-1.0.0.tar.gz
| Download URL | orcuspay-1.0.0.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
30d07758519cdc38dc64d53de3c6d39f77b17dd876595d1b4b5c70994f174cae
|
|
BLAKE2b-256 checksum How to use checksums |
d4f03a1df1079ea643764dd4cb3dd7ba233ef893eb88e22793c016693255d979
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / orcuspay-1.0.0-py3-none-any.whl
| Download URL | orcuspay-1.0.0-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1eff4adfdba054187e2b541c32a7c709c563c13bf4e43d2f59e1ba3e129cadd1
|
|
BLAKE2b-256 checksum How to use checksums |
e910996e3660971bff138426c5c5019c03d6465d3f483e83a765b5e7aab0b0f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Security for orcuspay 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.