@coderafiki/mpesa-tsc
v1.0.35
Published
A wrapper for mpesa api using typescript
Downloads
20
Readme
mpesa-tscwrapper
Wrapper for Mpesa Daraja Api using typescript
npm intall --save mpesa-tsc
yarn add mpesa-tsc
import {Mpesa} from 'mpesa-tsc'
let mpesaService = new Mpesa(
CONSUMER_KEY, /* get this from mpesa */
CONSUMER_SECRET,
SANDBOX_SHORT_CODE,
'random password',
CALLBACK_URL /* to get responses from mpesa */
)
let response = mpesaService.lipaNaMpesaOnline({
Amount: '500',
PartyA: '254700123456',
PhoneNumber: '254700123456',
AccountReference: 'YOUR RANDOM REFERENCE CODE',
TransactionDesc: 'description',
})