Skip to content

kkiapay/js-sdk

Repository files navigation

KKIAPAY

Build Status npm version

Javascript Sdk for KKIAPAY (https://kkiapay.me) API

Features

  • MTN Mobile Money Debit & Transfer Request
  • Flooz Mobile Money Debit Request
  • Ecobank Express Cash
  • Visa card payments
  • Master card payments

Installing

Using npm:

$ npm i -s kkiapay

Using cdn:

<script src="https://unpkg.com/kkiapay/dist/kkiapay.bundle.js"></script>

Example

Mobile Money

Performing a Debit request

// setup your api key (find one at https://www.kkiapay.me)
const k = kkiapay("<your-api-key>")

//request 100 XOF from 67 43 42 70, mobile money account
k.debit("22967434270",100).then((res) => {
    // handle response
}).catch((err) => {
    //handle error
})

Reference

Methods

.debit() Details

ArgumentTypeRequiredDetails
phoneStringYesValid mobile money number to debit. ex : 22967434270
amountNumericYesAmount to debit from user account (XOF)
firstnameStringNoClient firstname
lastnameStringNoClient lastname
emailStringNoClient email address

Response

Server responds in 3 cases :

  • user completes payment with success ( then block )
  • user rejected the approval request ( catch block)
  • user cancels the request for approval ( catch block )
  • timeout - 90s (catch block )
  • system error ( catch block )
Attribute Type When Details
failureCode ((string)) Failed The status of requested payment
  • processing_error System is busy or user already has a pending payment request
  • insufficent_fund User account balance is less than requested amount
  • failureMessage ((string)) Failed Description of error
    account ((string)) Failed / Success User phone number
    transactionId ((string)) Failed / Success Unique Transaction's identifier