ugmobilemoney


Nameugmobilemoney JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/open-ug/ugmobilemoney-py
SummaryCarry out Mobile Money Collections and Disbursements from various providers in Uganda
upload_time2024-03-18 10:39:22
maintainer
docs_urlNone
authorBeingana Jim Junior
requires_python>=3.6
licenseMIT
keywords mobilemoney uganda africa airtel python payments collections disbursements mtn
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # <img src="https://flagcdn.com/w40/ug.png"> UG MOBILE MONEY

UG Mobile Money is a python library for making mobile money transactions in Uganda. It currently supports MTN MOMO and Yo Payments

UG Mobile Money provides a simple interface for making mobile money transactions in a way that is similar to what the official MTN Mobile Money API provides but in a more pythonic and simple way. This makes it easy for beginners to get started and also for experienced developers who have been using the official API shift.

The library also handles other underlying functions like encryption, Authorization and regenerating access tokens. This makes it easy for developers to focus on the business logic of their applications and not worry about the underlying details.

The library utitlizes the Official MTN Mobile Money API. The API is documented [here](https://momodeveloper.mtn.com).


## Installation

Use the package manager [pip](https://pip.pypa.io/en/stable/) to install UG Mobile Money.

```sh
pip install ugmobilemoney
```

After installing it you can now import the package in your project.

```python
from mobile_money.momo import Collection, Disbursment
```

## Usage

This library is currently in development and only supports MTN MOMO. It supports the following operations:

- Collection
  - Request to pay
- Disbursment
  - Transfer

> **Note:** You need to have an account with MTN MOMO and have your API user ID and API key. You can get these from the [MTN MOMO Developer Portal](https://momodeveloper.mtn.com). If your in sandbox environment, we provide utils for creation of API user ID and API key.

### Collection

The UG Mobile Money library provides a `Collection` class that can be used to carry out operations or call the MOMO APIs provided under the collection Products.

You access it from the `mobile_money.momo` module.

```py
from mobile_money.momo import Collection


collection = Collection(
    subscription_key=SUBSCRIPTION_KEY,
    api_user=API_USER,
    api_key=API_KEY,
    callback_url="http://mydomain.com/webhooks/mtn/",
    production=False,
)
```

### Request to Pay

Request to pay is a service that allows a merchant to receive payments on from a customer. This is typically used when a customer is paying for goods or services. The `collect()` method is used to initiate a request to pay transaction.

```py
from mobile_money.momo import Collection
from mobile_money import generate_uuid

collection = Collection(
    subscription_key=SUBSCRIPTION_KEY,
    api_user=API_USER,
    api_key=API_KEY,
    callback_url="http://mydomain.com/webhooks/mtn/",
    production=False,
)

transaction_reference = generate_uuid()
# Request to pay
response = COLLECTION.collect(
    amount="100",
    phone_number="256772123456",
    currency="UGX",
    external_id="external id",
    reference_id=transaction_reference,
    payee_note="test",
    payer_message="test",
)

print(response)

# >>> <Response [202 Accepted]>
```

### Disbursment

The UG Mobile Money library provides a `Disbursment` class that can be used to carry out operations or call the MOMO APIs provided under the Disbursment Products.

You access it from the `mobile_money.momo` module.

```py
from mobile_money.momo import Disbursment

DISBURSEMENT = Disbursment(
    subscription_key=SUBSCRIPTION_KEY,
    api_user=API_USER,
    api_key=API_KEY,
    callback_url="http://mydomain.com/webhooks/mtn/",
    production=False,
)
```

### Transfer

Transfer is a service that allows a merchant to transfer money from their account to a customer's account. This is typically used when a customer is receiving money for goods or services. The `transfer()` method is used to initiate a transfer transaction.

```py
from mobile_money.momo import Disbursment
from mobile_money import generate_uuid

DISBURSEMENT = Disbursment(
    subscription_key=SUBSCRIPTION_KEY,
    api_user=API_USER,
    api_key=API_KEY,
    callback_url="http://mydomain.com/webhooks/mtn/",
    production=False,
)

transaction_reference = generate_uuid()

# Transfer
response = DISBURSEMENT.transfer(
    amount="100",
    phone_number="256772123456",
    currency="UGX",
    external_id="external id",
    reference_id=transaction_reference,
    payee_note="test",
    payer_message="test",
)

print(response)

# >>> <Response [202 Accepted]>
```

## Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

## License

MIT License (MIT). Please see [License File](LICENSE) for more information.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/open-ug/ugmobilemoney-py",
    "name": "ugmobilemoney",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "mobilemoney,uganda,africa,airtel,python,payments,collections,disbursements,mtn",
    "author": "Beingana Jim Junior",
    "author_email": "jimjunior854@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/70/1e/07df1941283425828fcb371fd5a6282dae244b1b72b35a5f9018e950a8c3/ugmobilemoney-0.1.0.tar.gz",
    "platform": null,
    "description": "# <img src=\"https://flagcdn.com/w40/ug.png\"> UG MOBILE MONEY\n\nUG Mobile Money is a python library for making mobile money transactions in Uganda. It currently supports MTN MOMO and Yo Payments\n\nUG Mobile Money provides a simple interface for making mobile money transactions in a way that is similar to what the official MTN Mobile Money API provides but in a more pythonic and simple way. This makes it easy for beginners to get started and also for experienced developers who have been using the official API shift.\n\nThe library also handles other underlying functions like encryption, Authorization and regenerating access tokens. This makes it easy for developers to focus on the business logic of their applications and not worry about the underlying details.\n\nThe library utitlizes the Official MTN Mobile Money API. The API is documented [here](https://momodeveloper.mtn.com).\n\n\n## Installation\n\nUse the package manager [pip](https://pip.pypa.io/en/stable/) to install UG Mobile Money.\n\n```sh\npip install ugmobilemoney\n```\n\nAfter installing it you can now import the package in your project.\n\n```python\nfrom mobile_money.momo import Collection, Disbursment\n```\n\n## Usage\n\nThis library is currently in development and only supports MTN MOMO. It supports the following operations:\n\n- Collection\n  - Request to pay\n- Disbursment\n  - Transfer\n\n> **Note:** You need to have an account with MTN MOMO and have your API user ID and API key. You can get these from the [MTN MOMO Developer Portal](https://momodeveloper.mtn.com). If your in sandbox environment, we provide utils for creation of API user ID and API key.\n\n### Collection\n\nThe UG Mobile Money library provides a `Collection` class that can be used to carry out operations or call the MOMO APIs provided under the collection Products.\n\nYou access it from the `mobile_money.momo` module.\n\n```py\nfrom mobile_money.momo import Collection\n\n\ncollection = Collection(\n    subscription_key=SUBSCRIPTION_KEY,\n    api_user=API_USER,\n    api_key=API_KEY,\n    callback_url=\"http://mydomain.com/webhooks/mtn/\",\n    production=False,\n)\n```\n\n### Request to Pay\n\nRequest to pay is a service that allows a merchant to receive payments on from a customer. This is typically used when a customer is paying for goods or services. The `collect()` method is used to initiate a request to pay transaction.\n\n```py\nfrom mobile_money.momo import Collection\nfrom mobile_money import generate_uuid\n\ncollection = Collection(\n    subscription_key=SUBSCRIPTION_KEY,\n    api_user=API_USER,\n    api_key=API_KEY,\n    callback_url=\"http://mydomain.com/webhooks/mtn/\",\n    production=False,\n)\n\ntransaction_reference = generate_uuid()\n# Request to pay\nresponse = COLLECTION.collect(\n    amount=\"100\",\n    phone_number=\"256772123456\",\n    currency=\"UGX\",\n    external_id=\"external id\",\n    reference_id=transaction_reference,\n    payee_note=\"test\",\n    payer_message=\"test\",\n)\n\nprint(response)\n\n# >>> <Response [202 Accepted]>\n```\n\n### Disbursment\n\nThe UG Mobile Money library provides a `Disbursment` class that can be used to carry out operations or call the MOMO APIs provided under the Disbursment Products.\n\nYou access it from the `mobile_money.momo` module.\n\n```py\nfrom mobile_money.momo import Disbursment\n\nDISBURSEMENT = Disbursment(\n    subscription_key=SUBSCRIPTION_KEY,\n    api_user=API_USER,\n    api_key=API_KEY,\n    callback_url=\"http://mydomain.com/webhooks/mtn/\",\n    production=False,\n)\n```\n\n### Transfer\n\nTransfer is a service that allows a merchant to transfer money from their account to a customer's account. This is typically used when a customer is receiving money for goods or services. The `transfer()` method is used to initiate a transfer transaction.\n\n```py\nfrom mobile_money.momo import Disbursment\nfrom mobile_money import generate_uuid\n\nDISBURSEMENT = Disbursment(\n    subscription_key=SUBSCRIPTION_KEY,\n    api_user=API_USER,\n    api_key=API_KEY,\n    callback_url=\"http://mydomain.com/webhooks/mtn/\",\n    production=False,\n)\n\ntransaction_reference = generate_uuid()\n\n# Transfer\nresponse = DISBURSEMENT.transfer(\n    amount=\"100\",\n    phone_number=\"256772123456\",\n    currency=\"UGX\",\n    external_id=\"external id\",\n    reference_id=transaction_reference,\n    payee_note=\"test\",\n    payer_message=\"test\",\n)\n\nprint(response)\n\n# >>> <Response [202 Accepted]>\n```\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\n## License\n\nMIT License (MIT). Please see [License File](LICENSE) for more information.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Carry out Mobile Money Collections and Disbursements from various providers in Uganda",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/open-ug/ugmobilemoney-py"
    },
    "split_keywords": [
        "mobilemoney",
        "uganda",
        "africa",
        "airtel",
        "python",
        "payments",
        "collections",
        "disbursements",
        "mtn"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "22f3ecade1bbeb0a61a81dfefff85a8aadb4edec3b9159b3040a87a788852119",
                "md5": "95a213c98bcecb3b9048305d04795960",
                "sha256": "8a8a648eca3ae7dca2de7f855a28b2081318515418963b668f62625606d8c15e"
            },
            "downloads": -1,
            "filename": "ugmobilemoney-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "95a213c98bcecb3b9048305d04795960",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 15226,
            "upload_time": "2024-03-18T10:39:20",
            "upload_time_iso_8601": "2024-03-18T10:39:20.288281Z",
            "url": "https://files.pythonhosted.org/packages/22/f3/ecade1bbeb0a61a81dfefff85a8aadb4edec3b9159b3040a87a788852119/ugmobilemoney-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "701e07df1941283425828fcb371fd5a6282dae244b1b72b35a5f9018e950a8c3",
                "md5": "10b885ac49bbf57ed3f63dd2c8d681aa",
                "sha256": "1754fe25b1bcecbfc1bc45b4c59d547bace2912ca609443efe957d3899e5b4f0"
            },
            "downloads": -1,
            "filename": "ugmobilemoney-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "10b885ac49bbf57ed3f63dd2c8d681aa",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 11265,
            "upload_time": "2024-03-18T10:39:22",
            "upload_time_iso_8601": "2024-03-18T10:39:22.187497Z",
            "url": "https://files.pythonhosted.org/packages/70/1e/07df1941283425828fcb371fd5a6282dae244b1b72b35a5f9018e950a8c3/ugmobilemoney-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-18 10:39:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "open-ug",
    "github_project": "ugmobilemoney-py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "ugmobilemoney"
}
        
Elapsed time: 3.03364s