appconnect

0.0.13 • Public • Published

appconnect

AppConnect JS NPM Package

Installation

npm install appconnect

Usage

// Require the library
const appconnect = require('appconnect');
//use your AppConnect Public key
appconnect.config(APPCONNECT_PUBLIC_KEY); 
//Sample Request
try {
    const user = await appconnect.debitUser({
      user: 'USR_DAJBW09456621576050242252', //AppConnect User ID
      amount: 20000,  //Amount in Kobo
      remark: 'Top Up Wallet', //Transaction Remark
      reference: '' + Math.floor((Math.random() * 1000000000) + 1) + Date.now(), //Unique Reference
    });
}
catch (err) {
    console.log(err);
}
//Sample Request
try {
    const user = await appconnect.initializeDirectDebit({
      user: 'USR_DAJBW09456621576050242252', //AppConnect User ID
      reason: 'Subscription for Book Service',  //Reason for Direct Debit
      otp: '',  //if otp is required
    });
}
catch (err) {
    console.log(err);
}

Resources

  • services

    • getBanks
  • wallet

    • debitUser
    • initializeDirectDebit

Contributing

  • To ensure consistent code style we will be putting a contribution guideline below

Tests

To run tests

npm test

Todo

  • Proper resource examples
  • ES6 support

Package Sidebar

Install

npm i appconnect

Weekly Downloads

1

Version

0.0.13

License

MIT

Unpacked Size

9.77 kB

Total Files

5

Last publish

Collaborators

  • uncooloj