A Python wrapper for the SasaPay API
Project description
sasapay-python-sdk
A Python wrapper for the SasaPay API.
Installation
pip install sasapay-sdk
Usage
from sasapay import SasaPayAPI
# Initialize the API client
api = SasaPayAPI(
environment='sandbox',
client_id='CLIENT_ID',
client_secret='CLIENT_SECRET'
)
# Authenticate and get access token
access_token = api.authenticate()
print(f"Access Token: {access_token}")
# Perform a customer to business transaction
response = api.customer_to_business(
merchant_code='6**80',
network_code='63902',
phone_number='2547******280',
amount='1',
description='Deposit',
account_reference='2547******280',
callback_url='https://webhook.site/2986****-0dac-****-8091-f1e7afbc979d'
)
print(f"C2B Response: {response}")
# # Perform a business to customer transaction
response = api.business_to_customer(
merchant_code='6**80',
channel='63902',
receiver_account_number='2547******280',
amount='10',
description='B2C Payment',
merchant_reference='TestB2CB1',
callback_url='https://webhook.site/2986****-0dac-****-8091-f1e7afbc979d'
)
print(f"B2C Response: {response}")
# # Perform a business to business transaction
response = api.business_to_business(
merchant_code='6**80',
network_code='63902',
receiver_merchant_code='522522',
amount=10.00,
description='B2B Payment',
merchant_reference='TestB2BB1',
account_reference='125*****04',
receiver_account_type='PAYBILL',
callback_url='https://webhook.site/2986****-0dac-****-8091-f1e7afbc979d'
)
print(f"B2B Response: {response}")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sasapay-sdk-0.1.0.tar.gz
(16.2 kB
view hashes)
Built Distribution
Close
Hashes for sasapay_sdk-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38599db9f8e32665fb78053f08937063abc66ca608f862b2e4f72e50a63caed7 |
|
MD5 | ae361b73b313b8481fa1160e7f7a5c67 |
|
BLAKE2b-256 | af712c0307f6dcf5b55f46d92f8f28b05711846a5c415e89c6e31a2d4dbb032b |