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
-
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" )
-
Get Payment Token Generate a payment token using the get_token method:
token = client.get_token()
-
Request Payment
Use the generated token to request payment and receive the IPG URL: ipg_url = client.request_payment()
-
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spay-3.0.0.tar.gz.
File metadata
- Download URL: spay-3.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb5ce1a54c9b1d94ef783458e43595daf049af0fc91255a016756019e2776be0
|
|
| MD5 |
1724ddf24596ba859ada79406b89790b
|
|
| BLAKE2b-256 |
cbde6fe46a4abac2647369d8a8e3cf37b8e117f6c8bafc84fd37e9d2567a2a15
|
File details
Details for the file spay-3.0.0-py3-none-any.whl.
File metadata
- Download URL: spay-3.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12f336354bc81b1ae9e20918bd5a65fff5eddd24786fd075060a7b983bb48569
|
|
| MD5 |
678f27f95c0717cefd39cf50b138e4ff
|
|
| BLAKE2b-256 |
4c1054cfc0fa70096ea63f5d0cfc741e8bc1ac5ef1de2a8b6bc1c69cd933709f
|