Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 19 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@

## Introduction

The Node library provides easy access to Flutterwave for Business (F4B) v3 APIs for your Node apps. It abstracts the complexity involved in direct integration and allows you to make quick calls to the APIs.
The Node library provides easy access to Flutterwave's v3 APIs for developing your Node application. It abstracts the complexity involved in direct integration, enabling you to make quick calls to the APIs.
Available features include:

- Collections: Card, Account, Mobile money, Bank Transfers, USSD, Apple Pay, Google Pay, Fawry Pay, eNaira.
- Collections: Card, Account, Mobile Money, Bank Transfers, USSD, Apple Pay, Google Pay, Fawry Pay, and eNaira.
- Payouts and Beneficiaries.
- Recurring payments: Tokenization and Subscriptions.
- Split payments
- Card issuing
- Split payments.
- Card issuing.
- Transactions dispute management: Refunds and Chargebacks.
- Transaction reporting: Collections, Payouts, Settlements, Refunds, Chargebacks and Transaction timeline.
- Transaction reporting: Collections, Payouts, Settlements, Refunds, Chargebacks, and Transaction timeline.
- Bill payments: Airtime, Data bundle, Cable, Power, Toll, E-bills, and Remitta.
- Identity verification: Resolve bank account, resolve BVN information and generate OTP.
- Identity verification: Bank Account Verification, BVN Verification, and OTP Generation.

## Table of Content
## Table of Contents

1. [Requirements](#requirements)
2. [Installation](#installation)
Expand All @@ -39,29 +39,28 @@ Available features include:

## Requirements

1. Flutterwave for business (F4B) [API Keys](https://developer.flutterwave.com/docs/integration-guides/authentication)
2. Node 18 or higher.
1. Your Flutterwave [API Keys](https://developer.flutterwave.com/v3.0.0/docs/authentication#get-your-api-keys).
2. Node version 18 or higher.

## Installation

To install the package, run the following command in your Node terminal:
To install our package, run the following command in your Node terminal:

```sh
npm install flutterwave-node-v3
```

## Initialization

```javascript
```JavaScript
const Flutterwave = require('flutterwave-node-v3');
const flw = new Flutterwave(
process.env.FLW_PUBLIC_KEY,
process.env.FLW_SECRET_KEY,
);
```

For staging (Test environment), use the TEST API Keys and for production (Live environment), use LIVE API KEYS.
You can get your process.env.FLW_PUBLIC_KEY and process.env.FLW_SECRET_KEY from the Flutterwave dashboard. Read the [requirement section](#requirements) for more information on how to get your API keys.
For the staging (test) environment, use your test API keys, and for the production (live) environment, use your live API keys. You can get your process.env.FLW_PUBLIC_KEY and process.env.FLW_SECRET_KEY from the Flutterwave dashboard. For more information on retrieving your API keys, visit the [requirement section](#requirements).

## Usage

Expand All @@ -84,20 +83,22 @@ You can get your process.env.FLW_PUBLIC_KEY and process.env.FLW_SECRET_KEY from

## Testing

All of the libraries tests are run on Mocha. Available tests include `rave.bank.test`, `rave.beneficiaries.test`, `rave.bills.test`, `rave.charge.test`, `rave.ebills.test`, `rave.settlements.test`, `rave.subscriptions.test`. They can be run by running the test command in your terminal.
All of the library's tests are run on Mocha. Available tests include `rave.bank.test`, `rave.beneficiaries.test`, `rave.bills.test`, `rave.charge.test`, `rave.ebills.test`, `rave.settlements.test`, `rave.subscriptions.test`. You can run all tests by executing the test command in your terminal.

```sh
npm run test or npm test
npm run test
or
npm test
```

## Debugging Errors

We understand that you may run into some errors while integrating our library. You can read more about our error messages [here](https://developer.flutterwave.com/docs/integration-guides/errors).
For `authorization` and `validation` error responses, double-check your API keys and request. If you get a `server` error, kindly engage the team for support.
We understand that you may encounter errors while integrating our library. You can read more about our error messages [here](https://developer.flutterwave.com/v3.0.0/docs/common-errors).
If you experience` authorization` or `validation` errors, double-check your API keys and request. For server errors, please contact our support team for assistance.

## Support

For additional assistance using this library, contact the developer experience (DX) team via [email](mailto:developers@flutterwavego.com) or on [slack](https://bit.ly/34Vkzcg).
For additional assistance using this library, contact the Developer Experience (DX) team via [email](mailto:developers@flutterwavego.com) or on [slack](https://bit.ly/34Vkzcg).
You can also follow us [@FlutterwaveEng](https://twitter.com/FlutterwaveEng) and let us know what you think 😊.

## Contribution guidelines
Expand Down
20 changes: 10 additions & 10 deletions documentation/banks.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@

# BANKS

We recommend reading the main readme first, to understand the requirements for using the library and how to initiate this in your apps. This guide assumes you've read that.
We recommend that you first review the [main README](../README.md) to understand the requirements for using our library and how to implement it in your applications. This guide assumes you have done that.

Fetch Bank details via any of these methods:
1. [Fetch all Banks](#get-all-banks)
2. [Fetch Bank Branches](#get-bank-branches)

## Get all banks

This describes how to get list of banks you can transfer to
This section describes how to get a list of banks you can make transfers to.

```javascript
```JavaScript
const Flutterwave = require('flutterwave-node-v3');

const flw = new Flutterwave(process.env.FLW_PUBLIC_KEY, process.env.FLW_SECRET_KEY );
Expand All @@ -24,7 +24,7 @@ const getBanks = async () => {
try {
const payload = {

"country":"NG" //Pass either NG, GH, KE, UG, ZA or TZ to get list of banks in Nigeria, Ghana, Kenya, Uganda, South Africa or Tanzania respectively
"country": "NG" //Pass either NG, GH, KE, UG, ZA, or TZ to get a list of banks in Nigeria, Ghana, Kenya, Uganda, South Africa, or Tanzania, respectively.

}
const response = await flw.Bank.country(payload)
Expand All @@ -40,7 +40,7 @@ getBanks();
```
Sample Response

```javascript
```JavaScript
{
"status": "success",
"message": "Banks fetched successfully",
Expand Down Expand Up @@ -356,9 +356,9 @@ Sample Response

## Get bank branches

This describes how to get a list of bank branches
This section describes how to get a list of bank branches.

```javascript
```JavaScript
const Flutterwave = require('flutterwave-node-v3');

const flw = new Flutterwave(process.env.FLW_PUBLIC_KEY, process.env.FLW_SECRET_KEY );
Expand All @@ -369,7 +369,7 @@ const getBranches = async () => {
try {
const payload = {

"id":280 //Unique bank ID, it is returned in the call to fetch banks GET /banks/:country
"id":280 //Unique bank ID, it is returned in the call to fetch banks GET /banks/:country.

}
const response = await flw.Bank.branches(payload)
Expand All @@ -385,7 +385,7 @@ getBranches();
```
Sample Response

```javascript
```JavaScript
{
"status": "success",
"message": "Bank branches fetched successfully",
Expand Down Expand Up @@ -425,7 +425,7 @@ Sample Response
{
"id": 996,
"branch_code": "GH190105",
"branch_name": "STANBIC BANK GHANA -NORTH INDUSTIAL AREA",
"branch_name": "STANBIC BANK GHANA -NORTH INDUSTRIAL AREA",
"swift_code": "SBICGHAC",
"bic": "SBICGHACXXX",
"bank_id": 280
Expand Down
32 changes: 16 additions & 16 deletions documentation/beneficiary.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# BENEFICIARIES

We recommend reading the main readme first, to understand the requirements for using the library and how to initiate this in your apps. This guide assumes you've read that.
We recommend that you first review the [main README](../README.md) to understand the requirements for using our library and how to implement it in your applications. This guide assumes you have done that.

Manage transfer beneficiaries via any of these methods:
1. [Create a Beneficiary](#create-a-beneficiary)
Expand All @@ -15,9 +15,9 @@ Manage transfer beneficiaries via any of these methods:

## Create a beneficiary

This describes how to create a transfer beneficiary
This section describes how to create a transfer beneficiary.

```javascript
```JavaScript

const Flutterwave = require('flutterwave-node-v3');

Expand All @@ -28,7 +28,7 @@ const createBeneficiary = async () => {
try {
const payload = {
"account_number": "0690000034",
"account_bank":"044" // This is the beneficiary’s bank code, you can use the List of Banks to retrieve a bank code.
"account_bank": "044" // This is the beneficiary’s bank code; you can use the List of Banks to retrieve a bank code.
"beneficiary_name": 'Ade Bond'
}
const response = await flw.Beneficiary.create(payload)
Expand All @@ -45,7 +45,7 @@ createBeneficiary();

Sample Response

```javascript
```JavaScript
{
"status": "success",
"message": "Banks fetched successfully",
Expand All @@ -62,9 +62,9 @@ Sample Response

## List all beneficiaries

This describes how to get all beneficiaries
This section describes how to get all beneficiaries.

```javascript
```JavaScript
const Flutterwave = require('flutterwave-node-v3');

const flw = new Flutterwave(process.env.FLW_PUBLIC_KEY, process.env.FLW_SECRET_KEY );
Expand All @@ -88,7 +88,7 @@ fetchAllBeneficiary();

Sample Response

```javascript
```JavaScript
{
"status": "success",
"message": "Payout beneficiaries fetched",
Expand Down Expand Up @@ -188,9 +188,9 @@ Sample Response

## Fetch a beneficiary

This describes how to get a single transfer beneficiary details
This section describes how to get a single transfer beneficiary's details.

```javascript
```JavaScript
const Flutterwave = require('flutterwave-node-v3');

const flw = new Flutterwave(process.env.FLW_PUBLIC_KEY, process.env.FLW_SECRET_KEY );
Expand All @@ -202,7 +202,7 @@ const fetchBeneficiary = async () => {
try {
const payload = {

"id":"2923" //This is the unique identifier for the beneficiary you intend to fetch. It is returned in the call to create a beneficiary as data.id
"id": "2923" //This is the unique identifier for the beneficiary you intend to fetch. It is returned in the call to create a beneficiary as data.id.

}
const response = await flw.Beneficiary.fetch(payload)
Expand All @@ -219,7 +219,7 @@ fetchBeneficiary();

Sample Response

```javascript
```JavaScript
{
"status": "success",
"message": "Payout beneficiary fetched",
Expand All @@ -237,10 +237,10 @@ Sample Response

## Delete a beneficiary

This describes how to delete a transfer beneficiary
This section describes how to delete a transfer beneficiary.


```javascript
```JavaScript
const Flutterwave = require('flutterwave-node-v3');

const flw = new Flutterwave(process.env.FLW_PUBLIC_KEY, process.env.FLW_SECRET_KEY );
Expand All @@ -251,7 +251,7 @@ const delBeneficiary = async () => {
try {
const payload = {

"id":"4150" //This is the unique identifier for the beneficiary you intend to fetch. It is returned in the call to create a beneficiary as data.id
"id": "4150" //This is the unique identifier for the beneficiary you intend to fetch. It is returned in the call to create a beneficiary as data.id.

}
const response = await flw.Beneficiary.delete(payload)
Expand All @@ -268,7 +268,7 @@ delBeneficiary();

Sample Response

```javascript
```JavaScript
{
"status": "success",
"message": "Beneficiary deleted",
Expand Down
Loading