0.3.0 • Published 6 years ago

node-ravepay v0.3.0

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

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
0.3.0

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago