A python wrapper for MedaPay you'll love
Project description
MedaPay Python SDK
MedaPay Python Library#
The MedaPay Python SDK provides convenient access to the MedaPay API from applications written in server-side python.
For complete request/response flow and types please check HTTP API Guide.
**Installation
Install the package with:
pip install medapaysdk
**Usage
The package needs to be configured with your account's bearer token, which is provided by MedaPay team. Require it and initialize with the provided token and preferred environment value:
Import MedaPay from "medapaysdk"
medaPay = MedaPay( isSandBox = True, merchantBearerToken = "Bearer blah-blah-blah", callbackWebhook = "https://test.herokuapps.com/" | None, callbackVerifyToken = "Verification token" | None )
You can either set callbackWebhook or not, it'll help you in payment push notification when working with none Amole payment methods
Amole Instance
Initialize new Amole Instance
orderId, billref, paymentInstance = medaPay.amole( name = "Abebe bekila", clientPhone = "251911355516", amount = 4, description = "A 4 birr bill to me", otp_sent_callback = def Callback )
Initialize from a pre-existing Bill reference
orderId, billref, paymentInstance = medaPay.amoleBill( name = "Abebe bekila", clientPhone = "251911355516", amount = 4, description = "A 4 birr bill to me", otp_sent_callback = def Callback )
After calling either of the above otp is directly sent. Will throw error if otp couldn’t be sent or if the bill is already paid or canceled
Amole Payment
isPaid: bool = paymentInstance.verifyPayment( otp = "4633" )["status"] == "PAYED"
Raw Bill creation
orderId, billref = medaPay.createBill(clientPhone = "251911355516" , amount = 4, name = "Abebe bekila" , method = "CBEBirr" | "mBirr" | "HelloCash", description="Something new")
Bill status retrieval
referenceNumber, accountNumber, status, amount, issuerName, createdAt, description = medaPay.getBillDetails(billref = 10000054)
isPayed: bool = (status == "PAYED")
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
Built Distribution
Hashes for medapaysdk-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 089d8735e92c6bc319107a55e0f8a762bc12dcab9f57134bec0d2263fb72156c |
|
MD5 | 9da1471958c31fa5c56456864a1b554a |
|
BLAKE2b-256 | 7839d8f7754561d97a2a171681fee658c283d59b0c8d873190e0605f07af13da |