0.3.0 • Published 8 years ago
node-ravepay
Licence
MIT
Version
0.3.0
Deps
2
Size
97 kB
Vulns
2
Weekly
0
Ravepay Nodejs Library
Ravepay Services exposed by the library
- Payments
- Account
- Card
- USSD
- Ghana Mobile
- Mpesa
- Validation
- Account
- Card
- Transactions
- Preauth
- Preauth
- Capture
- Refund
- Void
- Misc
- Security
- Encryption
- Intergrity Hash
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