Skip to main content

SantimPay Unofficial package

Project description

SantimPay Python API Package.

License Unofficial Python SDK for SantimPay

Introduction

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.

Installation

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

Usage

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)

Making Payments

Checkout pay

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())

Direct pay

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())

Contributing

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.

Run Locally

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

License

The MIT License (MIT). Please see License File for more information.

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

santimPay-1.0.1.tar.gz (8.5 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page