Mobile money API client built on top of BROKER. Yh the name is misleading becuase mobile money transfers have never been that instant. I believe we will get there soon.
I have been building apps that need mobile money integration and I realise I will probably be doing a lot of repetitive work all the time. Instantly hopes to solve that problem for me and for you too. One API for all my mobile money integrations built on top of SMSGH's BROKER
You, yes you, are a developer who is building the NBA (Next Big App) and the app needs to integrate with mobile money payments in Ghana, then use Instantly. First register on Unity, get your client_id
and client_secret
from Unity and go to Broker, create a wallet and go to token to retrieve your wallet token
.
You need postgres
and go
installed on your system to get this running:
- Clone the project to your $GOPATH
- Install the dependencies
- Run
$ git clone https://github.com/ngenerio/instantly
Create a config.yaml
in the root directory of this project. Specify the configuration as the example below:
SERVER_ENV: development # development or production
UNITY_CLIENT_ID: xxxxxxxx # Your unity client ID from SMSGH
UNITY_CLIENT_SECRET: xxxxxxxx # Your unity client secret from SMSGH
BROKER_TOKEN: xxxxx-xxxx-xxxx-xxxxx-xxxxxxxxx # Your broker token from broker
BROKER_SENDER: Instantly # Your app name
BROKER_CALLBACK_URL: https://<host>:/api/v1/payment/callback # Specify host as the url this app has been hosted at
BROKER_BASE_URL: https://api.smsgh.com/usp # Don't touch this
DB_NAME: postgres # Database name: either `postgres` or `mysql`
DB_PATH: user=<username> password=<password> host=<host> dbname=<somedb> sslmode=disable # Your database connection url
MIGRATIONS_DIR: db # Don't touch this
REDIS_URL: localhost:6379
REDIS_PASSWORD:
Create a dbconf.yml
in the db
folder and specify the configuration:
development:
driver: postgres
open: user=<username> password=<password> host=<host> dbname=<somedb_Test> sslmode=disable
production:
driver: postgres
open: user=<username> password=<password> host=<host> dbname=<somedb> sslmode=disable
Run these commands to install, build and run:
$ glide install
$ make build
$ ./instantly
This is the data you need to send to Instantly
:
{
"phoneNumber": "2332xxxxxxxx",
"amount": 50.00,
"mno": "TIGO",
"name": "Eugene Asiedu",
"type": "debit"
}
phoneNumber
- the phone number of the individualamount
- the account to be debited or creditedmno
- the mobile network operatorname
- the name of the individualtype
- either debit or credit
The payment endpoint is http://host
:port
/api/v1/payment. Send the your the token
you get after registering in the headers as:
X-Api-Key
:
$ curl -H "X-Api-Key: <Your API Token>" -X POST -d '{"phoneNumber":"2332xxxxxxxx","amount":50.00,"mno":"TIGO","name":"Eugene Asiedu","type":"debit"}' http://<host>:<port>/api/v1/payment