npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

redde-nodejs-sdk

v1.0.0

Published

Redde is a system that allows merchants to receive payments for goods and services. You can use the Redde portal to sweep your money into your bank account. Transactions via Redde happen online via a web browser or our Redde app available for iOS, Windows

Downloads

3

Readme

redde-nodejs-sdk

Nodejs Redde Merchant REST API that allows merchants to receive, send, check transaction status, and perform lots of payment transactions.

Before you can have access to APIs you need to register and create an Account on reddeonline. Header for all request should have {"apikey": "string"}: and this API key will be sent to merchant when their app configuration is setup for them by Wigal.

For more information on documentation go to developers.reddeonline.com

Installation

To use this library you'll need to have created a Redde account. To install this package and use in your project, we recommend using Npm.

npm i redde-nodejs-sdk                                                                                        

Usage

Importing redde-nodejs-sdk package

const Redde = require('redde-nodejs-sdk');

Import redde-nodejs-sdk at the top of your js file as shown above. Enter your API key and App ID which was provided to you by the Redde Team:


app_id = ""; //Enter Your App ID Here
api_key = ""; //Enter Your Api Key Here

//Instantiate ReddeApi class
const redde = new Redde(api_key, app_id);

Examples

Receiving money from Customer or Client

To use the API to recieve money from a customer, the receiveMoney() method will be used which takes takes 5 required arguments which are: amount, network type(MTN, AIRTELTIGO, VODAFONE), phone number, client reference, and client id respectively.

const request = require('request');
const Redde = require('redde-nodejs-sdk');
var express = require("express");
var myParser = require("body-parser");
var app = express();

app.use(myParser.json({ extended: true }));


app_id = ""; //Enter Your App ID Here
api_key = ""; //Enter Your Api Key Here

//Instantiate ReddeApi class
const redde = new Redde(api_key, app_id);


//Generating Random Client Reference
var ref = redde.clientRef(6);

//Generating Random Client ID
var clientid = redde.clientID(6);

//Calling Receive Function 
var receive = redde.receiveMoney(1, "MTN", 233240000004, ref, clientid);

//Sending a request to redde endpoint
request.post(receive, (err, res, body) => {
    if (err) {
        return console.log(err);
    }
    console.log(JSON.parse(JSON.stringify(body)));
});

//Callback Url Endpoint
app.post("/payment", function (req, res) {
    var data = req.body;
    res.send(data);

});


app.listen(8080);

Sending money to a Customer or Client

To use the API to send money to a customer, the sendMoney() method will be used which takes takes 5 required arguments which are: amount, network type(MTN, AIRTELTIGO, VODAFONE), phone number, client reference, and client id respectively.

const request = require('request');
const Redde = require('redde-nodejs-sdk');
var express = require("express");
var myParser = require("body-parser");
var app = express();

app.use(myParser.json({ extended: true }));


app_id = ""; //Enter Your App ID Here
api_key = ""; //Enter Your Api Key Here

//Instantiate ReddeApi class
const redde = new Redde(api_key, app_id);


//Generating Random Client Reference
var ref = redde.clientRef(6);

//Generating Random Client ID
var clientid = redde.clientID(6);

//Calling Receive Function 
var receive = redde.sendMoney(1, "MTN", 233240000004, ref, clientid);

//Sending a request to redde endpoint
request.post(receive, (err, res, body) => {
    if (err) {
        return console.log(err);
    }
    console.log(JSON.parse(JSON.stringify(body)));
});

//Callback Url Endpoint
app.post("/payment", function (req, res) {
    var data = req.body;
    res.send(data);

});


app.listen(8080);

Callbacks

Most APIs implement callbacks for easy tracking of api transactions so we have shown you how to implement. Check it out in the code below.


//Callback Url Endpoint
app.post("/payment", function (req, res) {
    var data = req.body;
    res.send(data);

});

License

This library is released under the MIT License