Skip to content

Commit

Permalink
Merge pull request #58 from re-kast/feature/issue_27
Browse files Browse the repository at this point in the history
📝 Update overview documentation
  • Loading branch information
dubdabasoduba authored Nov 3, 2024
2 parents d1b6bd2 + ccb0dde commit a0807fd
Show file tree
Hide file tree
Showing 18 changed files with 507 additions and 471 deletions.
95 changes: 51 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,85 +4,92 @@

## Overview

The MTN MOMO API SDK is an Android library designed to simplify the integration of MTN's Mobile Money (MOMO) services into native Android applications. This SDK provides developers with a seamless way to interact with MTN's mobile payment infrastructure, enabling features such as user authentication, balance inquiries, and transaction processing.
The MTN MOMO API SDK is a powerful and versatile Android library designed to simplify the integration of MTN’s Mobile Money (MOMO) services into native Android applications. This SDK enables developers to seamlessly interact with MTN’s extensive mobile payment infrastructure, facilitating core functionalities such as secure user authentication, balance inquiries, and efficient transaction processing. By abstracting the complexities of the MOMO API, this library provides a reliable and secure bridge between Android applications and MTN’s financial services, allowing developers to focus on building exceptional user experiences.

For more information about the MTN MOMO API, please visit the official documentation [here](https://momodeveloper.mtn.com/).

## Key Features

- Easy integration with MTN MOMO API
- Support for various MOMO operations:
- User information retrieval
- Account balance checks
- Payment requests and processing
- Disbursements and refunds
- Built with modern Android development practices:
- Kotlin language
- Coroutines for asynchronous operations
- Hilt for dependency injection
- Jetpack Compose for UI (in sample app)
- Comprehensive error handling and logging
- Secure API communication with proper authentication
The MTN MOMO API SDK offers a comprehensive suite of tools and functionalities that support a wide range of MOMO operations while adhering to modern Android development practices. Key features include:

## Getting Started
### Core Functionalities

- **Easy Integration with the MTN MOMO API**: This SDK simplifies the process of connecting to the MOMO API, allowing developers to concentrate on building their applications without getting bogged down by the underlying complexities.

- **Support for a Range of MOMO Operations**:
- **User Information Retrieval**: Effortlessly fetch and manage user data associated with MOMO accounts.
- **Account Balance Checks**: Securely retrieve account balances through API calls, providing users with a transparent view of their MOMO accounts.
- **Payment Requests and Processing**: Easily request and process payments via the MOMO API with minimal setup required.
- **Disbursements and Refunds**: Streamline automated disbursements and manage refunds directly from the application.

For a complete overview of available operations, refer to the full MTN MOMO API documentation [here](https://momodeveloper.mtn.com/docs).

### Built with Modern Android Development Practices

- **Kotlin**: Developed using Kotlin, the preferred language for Android development, ensuring compatibility with contemporary Android codebases.

- **Coroutines for Asynchronous Operations**: Utilizes Kotlin Coroutines to handle asynchronous operations efficiently, ensuring non-blocking API interactions that enhance user experience.

- **Hilt for Dependency Injection**: Integrates with Hilt, a widely-used dependency injection framework, promoting clean and maintainable code architecture.

- **Jetpack Compose for UI (Sample App)**: Includes a sample application built with Jetpack Compose, the modern UI toolkit, to demonstrate effective integration and best practices for implementing MOMO services.

For further exploration, check out the documentation on [Kotlin Coroutines](https://kotlinlang.org/docs/coroutines-overview.html), [Hilt](https://developer.android.com/training/dependency-injection/hilt-android), and [Jetpack Compose](https://developer.android.com/jetpack/compose).

### Additional Benefits

### Prerequisites
- **Comprehensive Error Handling and Logging**: The SDK comes equipped with built-in error handling and logging tools, enabling developers to track and resolve issues effectively, ensuring smooth functionality in production environments.

- **Secure API Communication**: Implements secure communication channels with proper authentication mechanisms, safeguarding all transactions and user data in compliance with industry standards.

- Android Studio Arctic Fox or later
- Kotlin 1.9.10 or later
- Minimum SDK version 24
- Compile SDK version 35
This SDK empowers Android developers to integrate MTN MOMO services confidently, providing secure and efficient mobile payment solutions.

For detailed instructions on integrating and configuring the MTN MOMO API SDK, please consult the official [MTN MOMO API documentation](https://momodeveloper.mtn.com/).

## Getting Started

### Installation

Add the following to your project's `build.gradle.kts` file:
To include the MTN MOMO API SDK in your project, add the following dependency to your project's `build.gradle.kts` file:

```
```kotlin
dependencies {
implementation("io.rekast:momo-api-sdk:0.0.2-SNAPSHOT")
}
```

### Sample `local.properties`

To configure your local environment, create a `local.properties` file in the root of your project with the following content:
To configure your local environment for the MTN MOMO API SDK, create a `local.properties` file in the root of your project with the following content:

```properties
# Local properties for the MTN MOMO API SDK

MOMO_BASE_URL="" ## use https://sandbox.momodeveloper.mtn.com for sandbox and https://momodeveloper.mtn.com for production
MOMO_BASE_URL="" ## Use https://sandbox.momodeveloper.mtn.com for sandbox and https://momodeveloper.mtn.com for production
MOMO_COLLECTION_PRIMARY_KEY="" ## The collection endpoint/product subscription primary key
MOMO_COLLECTION_SECONDARY_KEY="" ## The collection endpoint/product subscription secondary key
MOMO_REMITTANCE_PRIMARY_KEY="" ## The remittance endpoint/product subscription primary key
MOMO_REMITTANCE_SECONDARY_KEY="" ## The remittance endpoint/product subscription secondary key
MOMO_DISBURSEMENTS_PRIMARY_KEY="" ## The disbursements endpoint/product subscription primary key
MOMO_DISBURSEMENTS_SECONDARY_KEY="" ## The disbursements endpoint/product subscription secondary key
MOMO_API_USER_ID="" ## The sandbox API user ID you. You can use a [UUID generator](https://www.uuidgenerator.net/version4) to create one
MOMO_ENVIRONMENT="" ## API environment, use sandbox for testing and production for production
MOMO_API_VERSION_V1="" ## The API version for v1 endpoints, use v1_0 for sandbox and v1 for production
MOMO_API_VERSION_V2="" ## The API version for v2 endpoints, use v2_0 for sandbox and v2 for production
MOMO_API_USER_ID="" ## The sandbox API user ID. You can use a [UUID generator](https://www.uuidgenerator.net/version4) to create one
MOMO_ENVIRONMENT="" ## API environment, use 'sandbox' for testing and 'production' for live operations
MOMO_API_VERSION_V1="" ## The API version for v1 endpoints, use 'v1_0' for sandbox and 'v1' for production
MOMO_API_VERSION_V2="" ## The API version for v2 endpoints, use 'v2_0' for sandbox and 'v2' for production
```

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

1. Fork the project
2. Create your feature branch (`git checkout -b AmazingFeature`)
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the branch (`git push origin AmazingFeature`)
5. Open a Pull Request

## License

This project is licensed under the Apache License, Version 2.0. See the [LICENSE](LICENSE) file for details.
This project is licensed under the Apache License, Version 2.0. For more details, please refer to the [LICENSE](LICENSE) file.

## Contact

Benjamin Mwalimu Mulyungi - [GitHub](https://github.com/dubdabasoduba)
For inquiries or support, please reach out to:

Project Link: [https://github.com/re-kast/android-mtn-momo-api-sdk](https://github.com/re-kast/android-mtn-momo-api-sdk)
**Benjamin Mwalimu** [GitHub Profile](https://github.com/dubdabasoduba)

## Acknowledgments

- MTN for providing the MOMO API infrastructure
- The Android development community for various open-source libraries used in this project
- Contributors who have helped improve and maintain this SDK
- **MTN** for providing the MOMO API infrastructure.
- The **Android development community** for various open-source libraries utilized in this project.
- All **contributors** who have helped improve and maintain this SDK.
2 changes: 1 addition & 1 deletion android/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ secrets = "2.0.1"
spotless = "6.25.0"
timber = "5.0.1"
truth = "1.1.5"
vanniktechMavenPublish = "0.25.3"
vanniktechMavenPublish = "0.30.0"
workRuntimeKtx = "2.10.0"
coroutines = "1.9.0"
retrofit-coroutines = "0.9.2"
Expand Down
5 changes: 0 additions & 5 deletions android/momo-api-sdk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,6 @@ dependencies {
testImplementation(libs.mockk)
}

mavenPublishing {
publishToMavenCentral(SonatypeHost.S01, true)
signAllPublications()
}

tasks.named<org.jetbrains.dokka.gradle.DokkaTaskPartial>("dokkaHtmlPartial") {
dependsOn("kaptDebugKotlin", "kaptReleaseKotlin")
pluginConfiguration<DokkaBase, DokkaBaseConfiguration> {
Expand Down
7 changes: 7 additions & 0 deletions android/momo-api-sdk/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,10 @@ POM_DEVELOPER_ID=dubdabasoduba
POM_DEVELOPER_NAME=Benjamin Mwalimu
POM_DEVELOPER_URL=https://github.com/dubdabasoduba

#SONATYPE_HOST=S01
#SONATYPE_HOST=CENTRAL_PORTAL
SONATYPE_AUTOMATIC_RELEASE=true
SONATYPE_CONNECT_TIMEOUT_SECONDS=60
SONATYPE_CLOSE_TIMEOUT_SECONDS=900
RELEASE_SIGNING_ENABLED=true

Binary file removed static/img/docusaurus-social-card.jpg
Binary file not shown.
Binary file removed static/img/docusaurus.png
Binary file not shown.
1 change: 0 additions & 1 deletion static/img/logo.svg

This file was deleted.

Binary file added static/img/momo_subscription.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit a0807fd

Please sign in to comment.