Name | zignpay JSON |
Version |
0.1.0
JSON |
| download |
home_page | None |
Summary | A package to manage mobile payments using the MTN MoMo and Orange Money APIs |
upload_time | 2024-10-16 15:42:23 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | None |
keywords |
sample
setuptools
development
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# ZIGNPAY
[![build-status-image]][build-status]
[![coverage-status-image]][codecov]
[![pypi-version]][pypi]
## Make mobile payment easy
## Overview
A package to manage mobile payments using the MTN MoMo and Orange Money APIs
Some reasons you might want to use REST framework:
* Add a payment method to your website or application
* Create a mobile payment app
* Customization and extensibility
* Support for multiple operators
## Steps summary
* Sign up for an account
* Get a product subscription key
* Installation
* Create an API user and API key
* Initialize the collection class
* Make a payment request
## Getting Started
__Sign up for an account__
Head over to [https://momodeveloper.mtn.com/](https://momodeveloper.mtn.com/) and create your account. Once created, verify your account and sign in to the developer dashboard.
__Get a product subscription key__
The momo developer API is segmented into different products. Like; Collections, Remittances, Disbursement, and a collections widget. [Find and Subscribe](https://momodeveloper.mtn.com/products) to the product that your application will be using. For the case of this tutorial, we shall subscribe to the collections product. It enables us to make a remote collection of fees and bills. Once subscribed, you shall be able to get a _primary subscription key_ and a _secondary subscription key_ in your [developer dashboard](https://momodeveloper.mtn.com/developer).
__Installation__
## Requirements
* Python 3.10+
```bash
pip install zignpay
```
__Create an API user__
```python
import os
from zignpay.momo import MomoApiProvisioning, MomoCollection
"""
Here we will subscribe to the product collection.
"""
subscription_key = os.environ('subscription_key') # Put the subscription key that you copied
"""
Keep in mind that your subscription key in development is different in production,
To go into production you must click on Go Live in your Dashboard
"""
```
The MOMO API relies heavily on unique identifying identifiers called UUIDs. Each API user you create will have a unique UUID, zignpay will generate this automatically for you.
```python
...
momo = MomoApiProvisioning({
"subscription_key" : subscription_key,
"environment" : "DEV" # Define DEV if you are in development and PROD if you are in production
})
api_user = momo.create_api_user() # This returns the unique reference (UUID) of the created API user
if api_user: #Check if the query returns an object
api_key = momo.create_api_key() # Then generate the API key
"""
You can save these two values in a secure database, they will be necessary later.
"""
```
__Initialize the collection class__
```python
...
collection = MomoCollection({
"api_user_id" : api_user, # The user reference created above
"api_key" : api_key, # The api key created above
"subscription_key" : subscription_key, # The subscription key for the collection product
"environment" : "DEV",
"country_code" : "CM", # our Country Codes Alpha-2
})
```
You will find your [Country codes](https://www.iban.com/country-codes) here.
__Make a payment request__
```python
...
requestToPay = collection.request_to_pay({
"amount": 15, # Payment request amount
"from": "2376xxxxxxxx", # Example of Cameroonian number
"reference_id": "123456789",
"description": "Requested to pay" # Put your own description
})
```
Example query result
```python
{
'financialTransactionId': '490639485',
'externalId': '123456789',
'amount': '15',
'currency': 'EUR',
'payer': {
'partyIdType': 'MSISDN',
'partyId': '2376xxxxxxxx'
},
'payerMessage': 'Requested to pay',
'payeeNote': 'Thank you for your payment',
'status': 'SUCCESSFUL'
}
```
__We are currently working on improving this documentation__
Raw data
{
"_id": null,
"home_page": null,
"name": "zignpay",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "Kevelino <kevinnengou02@gmail.com>",
"keywords": "sample, setuptools, development",
"author": null,
"author_email": "Kevelino <kevinnengou02@gmail.com>",
"download_url": null,
"platform": null,
"description": "# ZIGNPAY\n\n[![build-status-image]][build-status]\n[![coverage-status-image]][codecov]\n[![pypi-version]][pypi]\n\n## Make mobile payment easy\n\n## Overview\n\nA package to manage mobile payments using the MTN MoMo and Orange Money APIs\n\nSome reasons you might want to use REST framework:\n\n* Add a payment method to your website or application\n* Create a mobile payment app\n* Customization and extensibility\n* Support for multiple operators\n\n## Steps summary\n\n* Sign up for an account\n* Get a product subscription key\n* Installation\n* Create an API user and API key\n* Initialize the collection class\n* Make a payment request\n\n## Getting Started\n\n__Sign up for an account__\n\nHead over to [https://momodeveloper.mtn.com/](https://momodeveloper.mtn.com/) and create your account. Once created, verify your account and sign in to the developer dashboard.\n\n__Get a product subscription key__\n\nThe momo developer API is segmented into different products. Like; Collections, Remittances, Disbursement, and a collections widget. [Find and Subscribe](https://momodeveloper.mtn.com/products) to the product that your application will be using. For the case of this tutorial, we shall subscribe to the collections product. It enables us to make a remote collection of fees and bills. Once subscribed, you shall be able to get a _primary subscription key_ and a _secondary subscription key_ in your [developer dashboard](https://momodeveloper.mtn.com/developer).\n\n__Installation__\n\n## Requirements\n\n* Python 3.10+\n\n```bash\n pip install zignpay\n```\n\n__Create an API user__\n\n```python\n import os\n from zignpay.momo import MomoApiProvisioning, MomoCollection\n\n\n \"\"\"\n Here we will subscribe to the product collection.\n \"\"\" \n subscription_key = os.environ('subscription_key') # Put the subscription key that you copied\n\n \"\"\"\n Keep in mind that your subscription key in development is different in production,\n To go into production you must click on Go Live in your Dashboard\n \"\"\"\n```\n\nThe MOMO API relies heavily on unique identifying identifiers called UUIDs. Each API user you create will have a unique UUID, zignpay will generate this automatically for you.\n\n```python\n ...\n momo = MomoApiProvisioning({\n \"subscription_key\" : subscription_key, \n \"environment\" : \"DEV\" # Define DEV if you are in development and PROD if you are in production\n })\n\n api_user = momo.create_api_user() # This returns the unique reference (UUID) of the created API user\n\n if api_user: #Check if the query returns an object\n api_key = momo.create_api_key() # Then generate the API key\n \"\"\"\n You can save these two values \u200b\u200bin a secure database, they will be necessary later.\n \"\"\"\n```\n\n__Initialize the collection class__\n\n```python\n ...\n collection = MomoCollection({\n \"api_user_id\" : api_user, # The user reference created above\n \"api_key\" : api_key, # The api key created above\n \"subscription_key\" : subscription_key, # The subscription key for the collection product\n \"environment\" : \"DEV\",\n \"country_code\" : \"CM\", # our Country Codes Alpha-2\n })\n```\n\nYou will find your [Country codes](https://www.iban.com/country-codes) here.\n\n__Make a payment request__\n\n```python\n ...\n requestToPay = collection.request_to_pay({\n \"amount\": 15, # Payment request amount\n \"from\": \"2376xxxxxxxx\", # Example of Cameroonian number\n \"reference_id\": \"123456789\", \n \"description\": \"Requested to pay\" # Put your own description\n })\n```\n\nExample query result\n\n```python\n {\n 'financialTransactionId': '490639485', \n 'externalId': '123456789', \n 'amount': '15', \n 'currency': 'EUR', \n 'payer': {\n 'partyIdType': 'MSISDN', \n 'partyId': '2376xxxxxxxx'\n }, \n 'payerMessage': 'Requested to pay', \n 'payeeNote': 'Thank you for your payment', \n 'status': 'SUCCESSFUL'\n }\n```\n\n__We are currently working on improving this documentation__\n",
"bugtrack_url": null,
"license": null,
"summary": "A package to manage mobile payments using the MTN MoMo and Orange Money APIs",
"version": "0.1.0",
"project_urls": {
"Bug Reports": "https://github.com/kevelino/zignpay/issues",
"Funding": "https://donate.pypi.org",
"Homepage": "https://github.com/kevelino/zignpay",
"Source": "https://github.com/kevelino/zignpay/"
},
"split_keywords": [
"sample",
" setuptools",
" development"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d91f8a97772d3cdbedd3ff776afd7c5bc1b828f77236a179f527d1692f4803a2",
"md5": "2526a19b3f70d8054c58250c6628ae5f",
"sha256": "982fde2a1ab207f4c605490be658b5c69c61441fd062074cc24792cf057b2dfc"
},
"downloads": -1,
"filename": "zignpay-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2526a19b3f70d8054c58250c6628ae5f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 5627,
"upload_time": "2024-10-16T15:42:23",
"upload_time_iso_8601": "2024-10-16T15:42:23.007456Z",
"url": "https://files.pythonhosted.org/packages/d9/1f/8a97772d3cdbedd3ff776afd7c5bc1b828f77236a179f527d1692f4803a2/zignpay-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-16 15:42:23",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "kevelino",
"github_project": "zignpay",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "zignpay"
}