Skip to content

Kotlin Multiplatform Library (Android, iOS, JVM & JS) for the Safaricom M-Pesa Daraja API ๐Ÿ”ฅ

License

Notifications You must be signed in to change notification settings

jeffnyauke/mpesa-kmp-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

13 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Build Kotlin GitHub License Maven Central badge-android badge-ios badge-mac badge-watchos badge-tvos badge-jvm badge-linux badge-windows badge-nodejs badge-browser

A Kotlin Multiplatform SDK for the Safaricom M-Pesa Daraja 2.0 API.

Supported features:

  • ๐Ÿคณ 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

At a glace

val mpesa = Mpesa("86smaD2TEnlXLVp9yOGvBiA9Znd3iHh3", "utbzOaE5a0LZFGB2")
val response = mpesa.stkPush(
    "174379",
    "bfb279f9aa9bdbcf158e97dd71a467cd2e0c893059b10f78e6b72ada1ed2c919",
    CustomerPayBillOnline,
    "1",
    "254708374149",
    "254708374149",
    "174379",
    "https://mydomain.com/path",
    "CompanyXLTD",
    "Payment of X",
)

Adding to your project

The library is available on Maven Central. Latest version Maven Central

Gradle

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>") 
    } 
  }
}

Contributing ๐Ÿค

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.

License ๐Ÿ“ƒ

mpesa-kmp-library is distributed under the terms of the Apache License (Version 2.0). See the license for more information.

Trademarks โ„ข๏ธ

M-PESA is a trademark of Vodafone Group Plc. and is not affiliated with this project.

About

Kotlin Multiplatform Library (Android, iOS, JVM & JS) for the Safaricom M-Pesa Daraja API ๐Ÿ”ฅ

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published