Skip to main content

Python SDK for Spay internet gateway

Project description

spay

SPAY Python SDK for integrating the SPAY Internet Payment Gateway (IPG) into Python applications.

This SDK provides a simple, structured interface to handle the full SPAY payment lifecycle:

  • Token generation
  • Payment request
  • Transaction verification

It is designed for backend services such as Django, FastAPI, Flask, or any Python-based system.


Installation

Install the SDK using pip:

pip install spay

Usage

  1. Create a Client Instance First, instantiate the SpayClient class.

    Required parameters: merchant_id (str) amount (int)

    Optional parameters: callback_url (str) mobile (str) email (str) description (str)

from spay import SpayClient

client = SpayClient( merchant_id="YOUR_MERCHANT_ID", amount=500000, callback_url="https://example.com/callback", mobile="09123456789", email="user@example.com", description="Order payment" )

  1. Get Payment Token Generate a payment token using the get_token method:

    token = client.get_token()

  2. Request Payment

    Use the generated token to request payment and receive the IPG URL: ipg_url = client.request_payment()

  3. Verify Payment

    After the payment process, SPay redirects the user to your callback_url. Verify the transaction using the verify_payment method: result = client.verify_payment(token)

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

spay-2.0.0.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

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

spay-2.0.0-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file spay-2.0.0.tar.gz.

File metadata

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

File hashes

Hashes for spay-2.0.0.tar.gz
Algorithm Hash digest
SHA256 b0a25f3da9c9a250f1e25a36ee3a03d7c1d0cefa637476ba9253b9875bf62dfb
MD5 14292ccdb43b97b4350b463e19eba69e
BLAKE2b-256 f339efa294a11926beed05e258ef6562f32b1a3aeb868afbd4fefee00674e2f6

See more details on using hashes here.

File details

Details for the file spay-2.0.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for spay-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 91428f0e9aed83b1820864a9dbe72c001976dad6ed4aec9d34b20f114af28192
MD5 a076a4f7f65910bf0670445599e6a28f
BLAKE2b-256 94847f4531ac444dcf6dd028006c0872d9a6dcf97d5e65161ce984e374706a4a

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