Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

flutterwave

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flutterwave

A nodejs library for the Flutterwave API

  • 2.0.2
  • npm
  • Socket score

Version published
Weekly downloads
128
decreased by-58.58%
Maintainers
1
Weekly downloads
 
Created
Source

Flutterwave Nodejs API Library v1.0.0

Flutterwave Services exposed by the library

  • Account Payment
  • BIN Check
  • BVN Check
  • Card Charge
  • Disbursement
  • IP Check
  • List of banks and financial institutions

For more information on the services listed above, visit the Flutterwave DEV website

How to use

npm install flutterwave

You can get your MERCHANT_KEY and API_KEY from the dev dashboard. Go here if you don't have an account.

var Flutterwave = require('flutterwave');

var flutterwave = new Flutterwave(API_KEY, MERCHANT_KEY);
/*
To call a flutterwave class (Code-name for API endpoint group) do :
flutterwave.Class.method(param1..paramn, callback);
*/

flutterwave.IP.check('127.0.0.1', function(error, response, body){
	//do stuff with response
})

Callbacks and handling API response

The callback (usually the last argument passed to any of the method calls) takes three parameters:

{
	"status" : "success|error",
	"data" : "OBJECT | error message"
}

Note that calls to the flutterwave API sometimes return with a successful status even when the request failed. Please check the returned data object and see the responseCode property. Values 0, 00, 02 indicate your request was successful. Any other value indicates failure, check the responseMessage to get the failure reason. While a responseCode of 02 indicates a successful request, it also means you need to make a subsequent validation call using information returned from the previous request. To make things a tad simpler, the response object has been mutated to include two boolean properties:

  • response.flutterwaveRequestSuccessful - If true, means the request was 'truly' successful

  • response.flutterwaveRequestRequiresValidation - Usually true when the responseCode is 02

As a rule of thumb, always put your flutterwave calls in a try block. The library throws errors whenever:

  • Required params are not passed
  • Values are empty
  • Values are not in the expected format See the example directory for more usage information

Keywords

FAQs

Package last updated on 26 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc