node-ravepay
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

Ravepay Nodejs Library

Ravepay Services exposed by the library

Todo

  • Disbursement
  • Tokenize
  • Type Responses

For more information on the services listed above, visit the Ravepay website

Usage

yarn add node-ravepay

or

npm install --save node-ravepay

This library supports RavePay staging and Production requests, you'll need to get a PUBLIC_KEY and SECRET_KEY from the RavePay dashboard.

See here on how to obtain your keys.

Using CJS

const Ravepay = require('node-ravepay');
 
const rave = new Ravepay(PUBLIC_KEY, SECRET_KEY);

Using Typescript or ESM

import Ravepay from 'node-ravepay';
 
const rave = new Ravepay(PUBLIC_KEY, SECRET_KEY);

The RavePay class takes an optional third argument

interface RaveOptions {
  /**
   * Sets the Rave API URL to the sandox url
   *
   */
  sandbox: boolean;
 
  /**
   * Generates an integrity hash for payment request to the flutterwave API
   *
   */
  generateIntegrityHash: boolean;
  /**
   * Specify your own custom endpoint where requests should be sent
   *
   */
  endpoint: string;
}

To send requests to the Rave Staging endpoint at http://flw-pms-dev.eu-west-1.elasticbeanstalk.com, you would write

const raveOptions = { sandbox: true };
const rave = new Ravepay(PUBLIC_KEY, SECRET_KEY, raveOptions);

The library also has typings if you're using Typescript

All methods returns promises

Payments

rave.Payments.cardPayment
rave.Payments.bankPayment
rave.Payments.ussdPayment
rave.Payments.ghanaMobilePayment
rave.Payments.recurringPayment
rave.Payments.mpesaPayment

Validation

rave.Validation.cardValidation
rave.Validation.bankValidation

Transactions

rave.Transactions.verify
rave.Transactions.query
rave.Transactions.refund
rave.Transactions.stopRecurringPayment
rave.Transactions.listAllRecurringTransactions
rave.Transactions.listSingleRecurringTransaction

Security

rave.Security.encrypt
rave.Security.generateIntegrityHash

/node-ravepay/

    Package Sidebar

    Install

    npm i node-ravepay

    Weekly Downloads

    1

    Version

    0.3.0

    License

    MIT

    Unpacked Size

    98.9 kB

    Total Files

    65

    Last publish

    Collaborators

    • lovebondz