Code Monkey home page Code Monkey logo

mpesa-kmp-library's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.