Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/ziscky/mock-pesa

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/ziscky/mock-pesa

  • v0.0.0-20160724132455-d50f84017f2c
  • Source
  • Go
  • Socket score

Version published
Created
Source

mock-pesa

Docker Repository on Quay Build Status Build Status Issue Count Codeclimate GPA

A set of mock MPESA APIs designed to work exactly like the real APIs. Great for unit tests and payment system hardening

Precompiled binaries

Precompiled binaries for released versions are available in the releases section of the GitHub repository. Supported OS/Arch:

  1. Darwin X64

  2. FreeBSD X64

  3. Linux X64

  4. Windows X64

Container images

Container images are available on https://quay.io/repository/ziscky/mock-pesa.
Simply: docker pull quay.io/ziscky/mock-pesa

Getting Started

For the docker container:
docker run -e MERCHANT_ID=1234 -e PASSKEY=4321 -p 7000:7000 --rm quay.io/ziscky/mock-pesa

For the precompiled binaries:
MERCHANT_ID=1234 PASSKEY=4321 ./mock-pesa
OR
./mock-pesa -conf=/path/to/conf

Example Config

MaxAmount=70000  

MinAmount=10  

MaxCustomerTransactionPerDay=150000  

MerchantID="12345"  

CallBackDelay=0  

SAGPasskey="54321"  

EnabledAPIS = ["c2b"]  

Building From Source

go get github.com/ziscky/mock-pesa
go test
go build github.com/ziscky/mock-pesa -o mock-pesa

How To

Follow the official MPESA API guide, replace:
Endpoint: http://localhost:7000/
WSDL: https://safaricom.co.ke/mpesa_online/lnmo_checkout_server.php?wsdl
That's right, works exactly the same

For custom scenarios e.g Customer with insufficient funds:
Endpoint: http://localhost:7000/{code}
where code is one of the official MPESA response codes,in this case: 01

Known Issues

Local WSDL doesn't play well with most SOAP clients
Use https://safaricom.co.ke/mpesa_online/lnmo_checkout_server.php?wsdl

Contiributing

I'm very open to PRs.

  • Fork
  • Create Branch
  • Do magic
  • Initiate PR

FAQs

Package last updated on 24 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc