Skip to main content

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 page
  • get_checkout_session(id) — Retrieve a checkout session
  • list_payments(limit?, cursor?, status?) — List payments with pagination
  • get_payment(id) — Retrieve a single payment
  • list_payment_links(limit?, cursor?) — List payment links
  • create_payment_link(params) — Create a payment link
  • get_payment_link(id) — Retrieve a payment link
  • status() — 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+
  • requests library

License

MIT

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)

Source distribution for orcuspay 1.0.0
File Size Uploaded
orcuspay-1.0.0.tar.gz 4.3 kB Details

Built distribution (wheel)

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

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

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

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