mpesa rest api converts the mpesa api to a RESTful API that is easy for developers to use instead of the current SOAP web service provided by mpesa.
# Mpesa Rest API (MRA)
mpesa rest api converts the mpesa api to a RESTful API that is easy for developers to use instead of the current SOAP web service provided by mpesa.
## Installation
### Requirements
`` -Python 2.7 or 3.x``
### Configuration
In the settings file `` mpesa/settings.py`` scroll to the bottom and replace the following urls _VALIDATION_URL = "
127.0.0.1"_ and _CONFIRMATION_URL = "
127.0.0.1"_
with the validation and confirmation endpoint to your application respectively
example:
replace
```
VALIDATION_URL = "
127.0.0.1"
CONFIRMATION_URL = "
127.0.0.1"
```
with
```
VALIDATION_URL = "
myapplication"
CONFIRMATION_URL = "
myapplication"
```
### Development
````
git clone
github.com
cd mpesa-rest-api
pip install -r requirements.txt
python manage.py runserver
````
### Production (not ready for production)
````
git clone
github.com
cd mpesa-rest-api
pip install -r requirements.txt
./start.sh
````
### Docker
To run the application via using docker (docker should be installed on your machine) :
```
git clone
github.com
cd mpesa-rest-api
docker-compose up
```
## C2B Validation And Confirmation
For validation and confirmation you need to have validation end point that will receive validation requests in json form.
You also need to have a confirmation endpoint in your application that will receive confirmation requests from MRA(mpesa rest api).
When requesting for validation and confirmation G2 API access from safaricom, they will ask you for two endpoints, the validation and the confirmation endpoints.
Below are the endpoints you should give them once you you deploy MRA
**Confirmation endpoint** = **`
your_application_ip_address`**
**Validation endpoint** = **`
your_application_ip_address …