- Payments
- Account
- Card
- USSD
- Ghana Mobile
- Mpesa
- Validation
- Account
- Card
- Transactions
- Preauth
- Preauth
- Capture
- Refund
- Void
- Misc
- Security
- Encryption
- Intergrity Hash
- Disbursement
- Tokenize
- Type Responses
For more information on the services listed above, visit the Ravepay website
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
rave.Payments.cardPayment
rave.Payments.bankPayment
rave.Payments.ussdPayment
rave.Payments.ghanaMobilePayment
rave.Payments.recurringPayment
rave.Payments.mpesaPayment
rave.Validation.cardValidation
rave.Validation.bankValidation
rave.Transactions.verify
rave.Transactions.query
rave.Transactions.refund
rave.Transactions.stopRecurringPayment
rave.Transactions.listAllRecurringTransactions
rave.Transactions.listSingleRecurringTransaction
rave.Security.encrypt
rave.Security.generateIntegrityHash