Unofficial Python SDK for SantimPay
This document provides a comprehensive guide to integrating and using the SantimPay Payment Gateway SDK in your application. Santimpay is a powerful payment gateway that supports various payment methods, facilitating seamless transactions for businesses. This SDK simplifies interaction with SantimPay’s API, enabling operations such as initiating payments, verifying transactions, and managing subaccounts.
To use the SantimPay SDK in your project, you need to install it using pip, as it is a dependency for making HTTP requests it will also install httpx
as a dependency.
pip install santimPay
To begin using the SDK, import the SantimPay
class from the module and instantiate it with your secret key.
from santimPay import SantimPay
# Replace Your_merchant_id with your mechant_id from santimpay api
# Replace your private key with your own private key by generating it
# Replace test wit boolian value - default = False
santim_pay = SantimPay('Your_merchant_id', 'Your_private_key', test=False)
from santimPay.types import SantimPayCheckoutRequest, SantimPayOptions
request = SantimPayCheckoutRequest(
id,
amount,
paymentReason,
successRedirectUrl,
failureRedirectUrl,
notifyUrl,
cancelRedirectUrl,
direct = False
)
# options = SantimPayOptions()
response = santim_pay.checkout.create(
request
)
print(response.jsonSerialize())
from santimPay.types import SantimPayCheckoutRequest, SantimPayOptions
request = SantimPayCheckoutRequest(
id,
amount,
paymentReason,
successRedirectUrl,
failureRedirectUrl,
notifyUrl,
cancelRedirectUrl,
direct = False
)
# options = SantimPayOptions()
# replace phonne_number with actual phone number
response = santim_pay.directpay.telebirr.create(
request,
phone_number
)
# or
response = santim_pay.directpay.cbe.create(
request,
phone_number
)
print(response.jsonSerialize())
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. After that free to contribute to this project. Please read the CONTRIBUTING.md file for more information.
Clone the project
git clone https://github.com/nahom-d54/SantimPay.git
Go to the project directory
cd santimPay
Install dependencies
pip install -r requirements.txt
The MIT License (MIT). Please see License File for more information.