MonnifyEase Library
MonnifyEase simplifies interacting with the Monnify payment gateway in Python. It offers wrappers for various functionalities, streamlining payment processing for your projects.
Monnify (owned by Moniepoint) is a Nigerian payment gateway that allows businesses to accept payments easily and securely.
📝: Read more on Monnify api documentation: Monnify API DOCUMENTATION
📝: Read more on monnifyease api documentation: MonnifyEase DOCUMENTATION
Getting Started
You should create a Monnify account to generate:
- Monnify Secret Key
- Monnify Api Key
- Monnify Merchant Code
- Monnify Base URL
You can see this in the developer page >> API keys and Contracts section.
⚠️: Warning: Do not expose your secret key, api key, merchant code, base url or commit your any to git, or use them in client-side code.
💡: Take Note: The Monnify SDK is to be used from your front-end when integrating using Monnify.
✅: Good: Set your secret key, api key, base url and merchant code in environment variables as seen:
- MONNIFY_SECRET_KEY=your-secret-key
- MONNIFY_API_KEY=your-api-key
- MONNIFY_SECRET_KEY=your-secret-key
- MONNIFY_MERCHANT_CODE=your-merchant-code
Create a Virtual Environment
-
For Windows:
-
Create virtual environment
py -m venv <environment_name> -
Activate the virtual environment
<environment_name>\Scripts\activate
-
-
For Unix/macOS
-
Create virtual environment
python3 -m venv <environment_name> -
Activate the virtual environment
<environment_name>/bin/activate
-
Install monnifyease library:
pip install monnifyease
pipx install monnifyease
poetry add monnifyease
If you want to download the sdist packages directly:
Download the wheel distribution file and install using pip
pip install monnifyease-0.i.0-py3-none-any.whl
Download the source distribution file, and install using pip
pip install monnifyease-0.i.0.tar.gz
To get a development version of monnifyease
Clone from the dev branch GitHub repository, unzip and install:
git clone -b dev https://github.com/cla-bit/MonnifyEase.git
cd monnifyease
pip install monnifyease
API usage
Making a Transaction [Synchronous]
If after setting your secret key in environment variables, for a synchronous transaction process all you need to do is use the transaction API to make a transaction.
To create a transaction or initialize a transaction:
- import the Monnify API wrapper.
from monnifyease import Monnify, Currency, MERCHANT_CODE
client = Monnify()
create_transaction = client.transactions.initialize_transaction(
amount=1000.00,
customer_name="Test Customer",
customer_email="test@gmal.com",
payment_reference="test123prod",
payment_description="Testing payment",
currency=Currency.NGN.value,
merchant_contract_code=MERCHANT_CODE,
# add other parameters here
)
print(f"Transaction Created: {create_transaction}")
✅: Good: You can check your Monnify account, go to the Transaction page, and you will see the transaction just created.
Other Tools
Similar to calling the Monnify, you can also call other tools to make your work easy. For example:
from monnifyease import Currency
val1 = Currency.NGN.value
print(val1)
"NGN"
See documentation for more: https://monnifyease.readthedocs.io/en/latest/
Metadata
Release files for monnifyease 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| monnifyease-0.2.0.tar.gz | 14.2 kB | Without provenance | Details for monnifyease-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| monnifyease-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for monnifyease-0.2.0-py3-none-any.whl |
Total release size: 34.4 kB
Release files / monnifyease-0.2.0.tar.gz
| Download URL | monnifyease-0.2.0.tar.gz |
|---|---|
| Size | 14.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
82045fb9aa32566d4730937c27562c0e7811410d6ea11b7f6eebb0eef019ba34
|
|
BLAKE2b-256 checksum How to use checksums |
31f9cad53a22f9fc8eeb3e136810a5ea163c4006d656dcb86381cfcf2ea5884b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / monnifyease-0.2.0-py3-none-any.whl
| Download URL | monnifyease-0.2.0-py3-none-any.whl |
|---|---|
| Size | 20.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5ca7085e2993c71ef7a8e1b348878025e06c86e25b31eda7180190506a4646a6
|
|
BLAKE2b-256 checksum How to use checksums |
4f3d61a83ef6f56c7d817ea5ca084c36f16c4c04c3a3370411421e930008f923
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Security for monnifyease 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.