Giter Site home page Giter Site logo

mpesa-lnm-service's Introduction

M-PESA Lipa Na Mpesa API Service

Service consumes M-PESA API exposed via Daraja

Overview

M-Pesa works by sending two requests:-

(a) C2B Validation - which alllows the web service to respond with either success or failure in order to either complete or cancel a transaction. This option can be enabled or disabled and as such this request is optional.

(b) C2B Confirmation - which is an acknowledgment that a transaction was successful on M-PESA. This request is mandatory if Validation and Confirmation URLs are registered on M-PESA

The URL structure will be as below

Validation URL: http://IP:PORT/c2b/validation

Confirmation URL: http://IP:PORT/c2b/confirmation

The IP can be the load balanced IP that forwards traffic to the deployed application. The port will be what's provisioned on the load balancer. If using a direct server IP to the application, then the IP can be server IP and the port can be 8000, which is the default port in django.

C2B Validation Request Payload

{ "TransactionType":"Pay Bill", "TransID":"QD3J8AZH6T", "TransTime":"20220201064858", "TransAmount":"1500", "BusinessShortCode":"123123", "BillRefNumber":"202020", "InvoiceNumber":"", "OrgAccountBalance":"6549197.00", "ThirdPartyTransID":"", "MSISDN":"254720123123", "FirstName":"Dennis", "MiddleName":"", "LastName":"Wanyonyi" }

Build Docker Image

The project comes with a Dockerfile that can be used to build this django project to a docker image. The name of the image is up to you but for the commands below, we'll name the image the same as the project. In order to build a docker image, ensure you have docker installed on your machine and run below command

docker build -t lnm_service .

mpesa-lnm-service's People

Contributors

denniswanyonyi avatar

Watchers

 avatar

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.