Metadata-Version: 2.4
Name: mtn-momo-sdk
Version: 0.1.1
Summary: Python SDK for MTN Uganda MoMo API integration
Home-page: https://github.com/brucekyl/momo-sdk
Author: Bruce Bagarukayo
Author-email: Bruce Bagarukayo <bbagarukayo5@gmail.com>
License: MIT
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Requires-Dist: setuptools
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python


# momo-sdk

A lightweight Python SDK to interact with the MTN MoMo (Mobile Money) API. Supports sandbox and live environments for mobile money collections.

---

## 🔧 Features

- Get access tokens (sandbox or live)
- Check account holder status
- Request mobile money payments
- Track transaction status

---

## 📦 Installation

Install from [PyPI](https://pypi.org/project/momo-sdk/):

```bash
pip install momo-sdk
```

Or install from source:

```bash
git clone https://github.com/yourusername/momo-sdk.git
cd momo-sdk
pip install .
```

---

## 🛠️ Setup

To start using the SDK, instantiate the `Momo` class with your credentials:

```python
from momo_sdk import Momo
import uuid

momo = Momo(
    api_user="your_api_user",
    api_key="your_api_key",
    subscription_key="your_subscription_key",
    mode="development", # or "production"
    callback_url='your_callbackurl' # e.g https://example.com
)
```

---

## 🚀 Usage

### ✅ 1. Get API Context

```python
print(momo.get_env())         # sandbox or mtnuganda
print(momo.get_url())         # Base API URL
print(momo.get_callback())    # Callback URL
```

---

### 📞 2. Check Account Status

```python
status = momo.get_accountholder("256771234567")
print(status)
```

---

### 💰 3. Request Mobile Money Payment

```python
transaction_id = str(uuid.uuid4())

response = momo.deposit_money(
    msisdn="256771234567",  # Customer MSISDN
    amount="10000",         # Amount in UGX or EUR
    reference=transaction_id
)

print(response)
```

---

### 📦 4. Check Transaction Status

```python
result = momo.get_transaction(transaction_id)
print(result)
```

---

## 📁 Project Structure

```
momo_sdk/
├── momo.py           # SDK module
├── __init__.py
├── setup.py
├── pyproject.toml
├── README.md
└── LICENSE
```

---

## 🧪 Testing the API

> Sandbox credentials are required from:  
> [https://momodeveloper.mtn.com/](https://momodeveloper.mtn.com/)

Make sure:
- Your callback URL is set in the MTN portal
- Your user is created and provisioned
- Subscription key is valid for `collection`

---

## 📫 Contributing

Pull requests are welcome. For major changes, open an issue first to discuss your ideas.

---

## 📝 License

This project is licensed under the **MIT License**. See the [LICENSE](LICENSE) file for details.

---

## 👤 Author

**Your Name**  
GitHub: [@yourusername](https://github.com/yourusername)  
Email: your@email.com

---

## 🚨 Disclaimer

Use this SDK at your own risk. Ensure you follow MTN MoMo's terms, guidelines, and security protocols before deploying to production.
