![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Carry out Mobile Money Collections and Disbursements from various providers in Uganda
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.
Use the package manager pip to install UG Mobile Money.
pip install ugmobilemoney
After installing it you can now import the package in your project.
from mobile_money.momo import Collection, Disbursment
This library is currently in development and only supports MTN MOMO. It supports the following operations:
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. If your in sandbox environment, we provide utils for creation of API user ID and API key.
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.
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 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.
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]>
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.
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 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.
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]>
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
MIT License (MIT). Please see License File for more information.
FAQs
Carry out Mobile Money Collections and Disbursements from various providers in Uganda
We found that ugmobilemoney demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.