Code Monkey home page Code Monkey logo

mpesa-api's Introduction

FLASK MPESA API

This is a sample wrapper providing access to Mpesa Daraja api for the modules C2B, B2C and M-Pesa express(STK-PUSH)

Features

This repository only features the following APIs in Daraja:

  • C2B: Customer to Business (C2B) APIs and allows receiving payment notifications to your paybill
  • B2C: B2C API is an API used to make payments from a Business to Customers
  • M-Pesa Express (STK-PUSH): This API is a Merchant/Business initiated C2B (Customer to Business) Payment.

Requirements

The requirements needed to run this application is:

Installation

To install this application you will need first to clone it you pc, create a virtual env and install requirements.txt

git clone https://github.com/IanDanielM/Flask-Mpesa-API.git
python -m venv venv
pip install -r requirements.txt

Environment Variables

To run this project, you will need to add the following environment variables to your .env file

```env
CONSUMER_KEY = 
CONSUMER_SECRET = 
PASSKEY = 
SHORTCODE = 
SECURITY_CREDENTIALS= 
```

Configuration

configure your callback urls in the config.ini file

[URLS]
confirmurl = 
validateurl = 
timeouturl = 
resulturl = 
callbackurl = 

Running the application

FLASK_APP=main.py FLASK_DEBUG=1 flask run

mpesa-api's People

Contributors

iandanielm 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.