Git Product home page Git Product logo

mpesadaraja's Introduction

Mpesa Daraja

This is a sample android application to test Safaricom M-Pesa STK push using Twiga Engineering android-daraja-sdk library, android-daraja-sdk).

Requirements

  • Android Studio
  • Kotlin
  • Kotlin anko

Getting Safaricom credentials

  1. Create a developer account on the Safaricom Developer Portal (https://developer.safaricom.co.ke/)
  2. Create a Lipa na M-Pesa online app on the console
  3. Go to https://developer.safaricom.co.ke/test_credentials to get test credentials for transactions

Project setup

  1. On your android studio start screen, go to 'Check out from version control'
  2. Paste the clone link (https://github.com/tirgei/MpesaDaraja.git) then press clone
  3. Open the project

Firebase setup

You'll need to setup firebase which in this case will be used for authentication. We'll later use firebase to send confirmation notifications using Firebase functions once a transaction is successful.

  1. On your android studio, click on 'Tools' from the menu bar then Firebase.
  2. A firebase assistant pane will open from the right.
  3. Click on 'Authentication' then connect to firebase, the authentication dependency will be added
Update

You can check the firebase functions repo here: MpesaDaraja-Functions

Getting started

Create a Kotlin object named 'Constants' to hold the variables.

From the Safaricom test credentials page:

  • PAYBILL (Lipa na M-Pesa Online Shortcode)
  • PASSKEY (Lipa na M-Pesa Online Passkey)
  • ACCOUNT_REF (Initiator name)

From the app you created in your developer console:

  • CONSUMER_KEY
  • CONSUMER_SECRET

You're now all set to tinker around, Happy Coding :)

Screenshots

Libraries used

  1. Daraja - https://github.com/twigaeng/android-daraja-sdk
  2. Mikepenz Iconics (FontAwesome) - https://github.com/mikepenz/Android-Iconics
  3. PinView - https://github.com/ChaosLeong/PinView

mpesadaraja's People

Contributors

tirgei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mpesadaraja's Issues

Error opening this project

Desktop\Android Projects\MpesaDaraja-master\app\src\main\java\com\gelostech\mpesadaraja\activities\MainActivity.kt: (75, 30): Unresolved reference: Constants

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.