Skip to main content

Official ORBI Pay Gateway SDK for server-side payments, PaySafe escrow, identity lookup, and webhook verification.

Project description

ORBI Pay Gateway Python SDK

Official server-side Python SDK for ORBI Pay Gateway.

Use this SDK from a trusted backend only. Do not put ORBI service keys in browser, mobile, or public client code.

Install

Status: source package is ready for PyPI. Use this install command after the package is published to PyPI.

pip install orbi-pay-gateway

Create a payment

import os
from orbi_pay_gateway import Orbi

orbi = Orbi(
    base_url=os.environ["ORBI_PAY_GATEWAY_BASE_URL"],
    service_key=os.environ["ORBI_PAY_SERVICE_KEY"],
    environment=os.environ.get("ORBI_PAY_ENVIRONMENT", "Demo"),
)

intent = orbi.transfers.send(
    {
        "reference": "ORDER-10001",
        "amount": 125000,
        "currency": "TZS",
        "description": "Protected checkout",
        "customer": {"phone": "+255700000000"},
        "returnUrl": os.environ["ORBI_PAY_RETURN_URL"],
        "cancelUrl": os.environ["ORBI_PAY_CANCEL_URL"],
        "callbackUrl": os.environ["ORBI_PAY_WEBHOOK_URL"],
    },
    idempotency_key="payment-intent:merchant:ORDER-10001",
)

action = orbi.payments.next_action(intent["data"])
if action["type"] == "redirect_to_hosted_challenge":
    print(action["url"])

Verify payment updates

from orbi_pay_gateway import verify_and_parse_webhook

event = verify_and_parse_webhook(
    raw_body=request.data,
    signature_header=request.headers.get("x-orbi-pay-signature", ""),
    timestamp_header=request.headers.get("x-orbi-pay-timestamp", ""),
    secret=os.environ["ORBI_PAY_WEBHOOK_SECRET"],
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

orbi_pay_gateway-0.1.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

orbi_pay_gateway-0.1.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file orbi_pay_gateway-0.1.0.tar.gz.

File metadata

  • Download URL: orbi_pay_gateway-0.1.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for orbi_pay_gateway-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1380fd81bd559533e5687a26cd257671424a0f13c60dc3c782bdd20250cabba7
MD5 317ad269661d54b9aec851ee25c4672a
BLAKE2b-256 9d26f07efab3c8549a549a5e510276e434b870315ebf1de2b2a040542e4bf44d

See more details on using hashes here.

File details

Details for the file orbi_pay_gateway-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for orbi_pay_gateway-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 293c13400bbb70ca5dab555b32312747edc1cbe9ace1da197bcafdc0fa1713a4
MD5 f84675649e36c6fb210fb1d2092068e8
BLAKE2b-256 d9f291dacfa71451c93188fcdc19abb8930f691937e46165b31564b1c6435078

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page