Skip to content

maviance/smobilpay-python

Repository files navigation

Smobilpay S3P API Client for Python

This Python SDK provides a convenient interface to the Smobilpay S3P API. It supports Python version 3.7 and above, making it easy to integrate into your Python applications to interact with Smobilpay services.

Getting Started

Prerequisites

Ensure you have Python 3.7+ installed on your system. You can check your Python version by running:

python --version

Installation

Setting up the environment Start by creating a .env file at the root of your project to store your Smobilpay API credentials securely:

touch .env

Edit the .env file to add your Smobilpay API credentials and configuration settings:

# SMOBILPAY API credentials
SMOBIL_PAY_API_KEY=Your-api-Key
SMOBIL_PAY_API_SECRET=Your-top-secret-key
SMOBIL_PAY_LIVE_MODE=True
SMOBIL_PAY_API_URL=https://s3papidoc.smobilpay.maviance.info/v2
SMOBIL_PAY_API_URL_STAGING=https://s3p.smobilpay.staging.maviance.info/v2
SMOBIL_PAY_API_VERSION=3.0.0
SMOBIL_PAY_API_DEBUG=False

Install dependencies Ensure all required dependencies are installed by running:

pip install -r requirements.txt

Docker Setup

To containerize the Smobilpay S3P API Client, use the following Dockerfile:

docker build -t smobilpay-sdk .

docker run -it smobilpay-sdk /bin/bash

# Within the docker 
# run
python main.py

Usage

The official API documentation can be found at: https://apidocs.smobilpay.com

Here's a simple example to get you started with fetching account information using the SDK:

from services.account_service import AccountService

def main():
    # Initialize the Account service
    account_service = AccountService()
    account = account_service.fetch_account_info()
    print(account)

if __name__ == "__main__":
    main()

Please visit https://apidocs.smobilpay.com for usage documentation

Documentation for API Endpoints

All URIs are relative to /v2

Class Method HTTP request Description
AccountService fetch_account_info GET /account Retrieve account information and remaining account balance
ServiceNumberVerificationApi verify_service_number GET /verify Verify service number
CollectionService execute_payment_collection POST /collectstd Execute payment collection
PingService ping GET /ping Check on the availability of the api
BillService fetch_bills GET /bill Get bill payment handler
QuoteService request_quote POST /quotestd Request quote with price details about the payment
SubscriptionService fetch_subscriptions GET /subscription Get subscription payment handler
CashinService fetch_cashins GET /cashin Retrieve available cashin packages
CashoutService fetch_cashouts GET /cashout Retrieves available cashout packages
MerchantService fetch_merchants GET /merchant Retrieve list of merchants supported by the system.
ProductService fetch_products GET /product Retrieve list of available products
ServiceApi fetch_services GET /service Retrieve list of services supported by the system.
ServiceApi fetch_service_by_id GET /service/{id} Retrieve single service
TopupService fetch_topups GET /topup Retrieve available topup packages
VoucherService fetch_vouchers GET /voucher Retrieve list of available vouchers to purchase
PaymentHistoryService fetch_payment_history GET /historystd Retrieve list of historic payment collection.
PaymentStatusService fetch_payment_status GET /verifytx Get the current payment collection status

Documentation For Models