@coderafiki/mpesa-tsc

A wrapper for mpesa api using typescript

Usage no npm install needed!

<script type="module">
  import coderafikiMpesaTsc from 'https://cdn.skypack.dev/@coderafiki/mpesa-tsc';
</script>

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',
})