Unofficial Python Wrapper Library for the EcoCash API by Tarmica Sean Chiwara, A computer engineering student.
Project description
Ecocash Python Library
Simple, intuitive Python client for Ecocash Open API.
Installation
pip install ecocash
Quick Start
from ecocash import Ecocash
wallet = EcoCash(
app_id="app123", # provided by ecocash in the portal
api_key="key123", # provided by ecocash in the portal
merchant_code="850236", # for merchant payments
app_name="MyApp" # provided by ecocash in the portal
)
Make a payment
this is used to initiate transaction from *Merchant-Side to Customer-Side *(customer only has to approve transaction by inputting their pin)
result = wallet.initiate_payment(
customer_msisdn = "263774222475", # the customer number
amount = 10.5,
reason = "Payment test"
)
print(result)
Refund example
result = wallet.refund("uuid_here", "012345l61975", "263774222475", 10.5, "Vaya Africa", "USD", "Test refund")
print(result)
Transaction lookup example
result = wallet.check_transaction_status("263774222475", "uuid_here")
print(result)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ecocash-0.0.6.tar.gz.
File metadata
- Download URL: ecocash-0.0.6.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4ff761b1876c189f3aaaf0b3edcdbad4bfd25d09bba1634eca3c10c66bbdb58
|
|
| MD5 |
9e54f3eb92455f1cfa6e6f5b72f42ec0
|
|
| BLAKE2b-256 |
a2ea069ba22358a395817d02374d7f6f46a6d2abfa5e7974bbbfbbd56995ba76
|
File details
Details for the file ecocash-0.0.6-py3-none-any.whl.
File metadata
- Download URL: ecocash-0.0.6-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1cf9d284090e9c9065f3e7e06dbc4c4045fcb9f529395b3c010558bc41edcadd
|
|
| MD5 |
02872ebe7c41e9662dac0a40738bf5ee
|
|
| BLAKE2b-256 |
c950199aed2342f8cd808d32a88c108016fff7b4383e508b481ed7661a686531
|