Skip to main content

Official Python SDK for Paysgator API

Project description

Paysgator Python SDK

Official Python client for the Paysgator API.

Installation

pip install paysgator

Usage

from paysgator import PaysgatorClient

client = PaysgatorClient(api_key="YOUR_API_KEY")

# Create a payment
payment = client.payments.create(
    amount=100.0,
    currency="MZN",
    payment_methods=["MPESA", "CARD"],
    return_url="https://example.com/callback"
)
print(f"Payment Link: {payment.data.checkout_url}")
print(f"Transaction ID: {payment.data.transaction_id}")

# Confirm a payment (Server-side)
confirmation = client.payments.confirm(
    payment_link_id="payment_link_uuid",
    payment_method="MPESA",
    payment_fields={"phoneNumber": "841234567"}
)
print(f"Confirmed Transaction: {confirmation.data.transaction_id}")

# Check Balance
balance = client.wallet.get_balance()
print(f"Balance: {balance.balance} {balance.currency}")

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

paysgator-1.0.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

paysgator-1.0.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file paysgator-1.0.0.tar.gz.

File metadata

  • Download URL: paysgator-1.0.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for paysgator-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0bdc92047d5cf6a82ef7874c05aef84b8c347393c269b4185f396731e3f36de3
MD5 19d17a50e951987ae692e21536c418a2
BLAKE2b-256 0c810bb3c1f0330477b06a9b35f17deb0e577a4b753a1a7cb0c3a75eeb53f0ea

See more details on using hashes here.

File details

Details for the file paysgator-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: paysgator-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for paysgator-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4ab290adf2a4af47537144fc5db1204c40971a2c546aedbbf84143833622e42e
MD5 905a85e901eefdcabe354587377d9898
BLAKE2b-256 4be4a3ff7523c0d2c853449fe9910519ce17d120fc49091f4e4e84aa68c6b577

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