A Kotlin Multiplatform SDK for the Safaricom M-Pesa Daraja 2.0 API.
- 🤳 Dynamic QR
- 💶 STK Push - Lipa na M-Pesa Online API (M-PESA express)
- ⏳ STK Push query
- 📝 C2B register
- 💶 C2B
- 💶 B2C
- ⏳ Transaction status
- 🏦 Account balance
- 🔁 Transaction reversal
val mpesa = Mpesa("86smaD2TEnlXLVp9yOGvBiA9Znd3iHh3", "utbzOaE5a0LZFGB2")
val response = mpesa.stkPush(
"174379",
"bfb279f9aa9bdbcf158e97dd71a467cd2e0c893059b10f78e6b72ada1ed2c919",
CustomerPayBillOnline,
"1",
"254708374149",
"254708374149",
"174379",
"https://mydomain.com/path",
"CompanyXLTD",
"Payment of X",
)
The library is available on Maven Central. Latest version
Add the Maven Central repository if it is not already there.
repositories {
mavenCentral()
}
To use the library in a single-platform project, add a dependency.
dependencies {
implementation("io.github.jeffnyauke:mpesa:<version>")
}
In Kotlin Multiplatform projects, add the dependency to your commonMain
source-set dependencies.
sourceSets {
val commonMain by getting {
dependencies {
implementation("io.github.jeffnyauke:mpesa:<version>")
}
}
}
Please feel free to open an issue if you have any questions or suggestions. Or participate in the discussion. If you want to contribute, please read the contribution guidelines for more information.
mpesa-kmp-library is distributed under the terms of the Apache License (Version 2.0). See the license for more information.
M-PESA is a trademark of Vodafone Group Plc. and is not affiliated with this project.