Official Python SDK for the Piaxis partner API
Project description
Piaxis Python SDK
Official Python SDK for the Piaxis partner API.
- Package:
piaxis-sdk - Repository:
https://github.com/piaxepay/python-sdk - API docs:
https://docs.gopiaxis.com/api/payments/ - TypeScript SDK:
https://github.com/piaxepay/typescript-sdk
Install
pip install piaxis-sdk
Quick Start
from piaxis_sdk import PiaxisClient
client = PiaxisClient(api_key="your_api_key")
payment = client.create_payment(
{
"amount": "15000",
"currency": "UGX",
"payment_method": "mtn",
"user_info": {
"email": "buyer@example.com",
"phone_number": "+256700000000",
"otp": "123456",
},
}
)
print(payment["payment_id"])
Environment-based setup:
from piaxis_sdk import PiaxisClient
client = PiaxisClient.from_env()
Supported environment variables:
PIAXIS_API_KEYPIAXIS_ACCESS_TOKENPIAXIS_API_BASE_URL
The default base URL is https://api.gopiaxis.com/api.
Supported Operations
Full public paymentAPI coverage:
- Auth:
build_authorize_url(...),authorize_test(...),exchange_token(...) - Escrows:
create_escrow(...),get_escrow(...),get_escrow_status(...),release_escrow(...),fulfill_escrow_term(...),reverse_escrow(...),dispute_escrow(...) - OTP:
request_otp(...) - Payments:
create_payment(...),get_payment(...),list_merchant_payments(...) - Disbursements:
disburse(...),disbursements.get(...),disbursements.list(...),disbursements.cancel(...) - Escrow disbursements:
escrow_disburse(...),escrow_disbursements.get(...),escrow_disbursements.list(...),escrow_disbursements.release(...),escrow_disbursements.cancel(...)
Examples
examples/oauth_flow.pyexamples/direct_payment.pyexamples/escrow_flow.pyexamples/disbursement_flow.py
Local Development
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install --upgrade pip build twine
python3 -m pip install -e .
python3 -m compileall src
python3 -m unittest discover -s tests -p "test_*.py"
python3 -m build
python3 -m twine check dist/*
Publishing
This repo is intended to publish the piaxis-sdk package to PyPI.
python3 -m twine upload dist/*
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
piaxis_sdk-0.2.0.tar.gz
(12.5 kB
view details)
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 piaxis_sdk-0.2.0.tar.gz.
File metadata
- Download URL: piaxis_sdk-0.2.0.tar.gz
- Upload date:
- Size: 12.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
984d52329534009861e946d40cd3b8139d6378215468bbcfc9c4335a3c523be2
|
|
| MD5 |
c8ea3389ef63f884222e9fcf40c46cf2
|
|
| BLAKE2b-256 |
38e847bb413a5c47af0c4080adc3b7568dd803d14efe8fce3aa2c28a4b616d8e
|
File details
Details for the file piaxis_sdk-0.2.0-py3-none-any.whl.
File metadata
- Download URL: piaxis_sdk-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dcdf185e2c6560879efe6bc93cbbef7b22eeb71a925610a9d8e3031e92ce1945
|
|
| MD5 |
8c7610f72c98be5651fb8683c5095806
|
|
| BLAKE2b-256 |
1b6c12b5abd09dd2935642521758b7896dbc6dd9ccd3b6c7b855b09840cb28f5
|