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

cashfree-sdk

v0.1.1

Published

This module contains all methods to help you integrate cashfree's payout solution

Downloads

4,870

Readme

Cashfree libraries are released in Beta. This is work in progress and we are continuously working on improving various aspects of it. It is released as a learning aid and an example kit for the API integrators. This is not recommended by Cashfree for direct use in production code. Please report any bugs to Cashfree at [email protected].

cashfree-sdk-nodejs

The official Cashfree SDK for JavaScript, available for Node.js backends. Node version 10.9.0 was used for this SDK.

Get started quickly using Cashfree with the Cashfree SDK for JavaScript in Node.js. The SDK helps take the complexity out of coding by providing JavaScript objects for Cashfree services including Payouts, Payment Gateway, Marketplace and Autocollect. The single, downloadable package includes the Cashfree JavaScript Library and documentation.

Please refer to the Cashfree Docs for the complete API reference.

Installing

In Node.js

The preferred way to install the Cashfree SDK for Node.js is to use the npm package manager for Node.js. Simply type the following into a terminal window:

npm i cashfree-sdk

Getting Started

Pre-requisites

IP Whitelisting and dynamic IPs

Your IP has to be whitelisted to hit Cashfree's server. Or if you have a dynamic IP please pass in the public key parameter during the init method as shown below. For more information please go here.

Usage

Payouts

The package needs to be configured with your account's secret key which is available in your Cashfree Dashboard.

In case of static IP (Your IP is whitelisted)
const Cashfree = require("cashfree-sdk");

//Initialize Cashfree Payout
let Payouts = Cashfree.Payouts;
Payouts.Init({
    "ENV": "TEST", 
    "ClientID": "CLIENTID",
    "ClientSecret": "CLIENTSECRET"
});

In case of dynamic IP you will need a public key to generate a signature(which will be done by sdk itself)
const Cashfree = require("cashfree-sdk");

//Initialize Cashfree Payout
let Payouts = Cashfree.Payouts;
Payouts.Init({
    "ENV": "TEST", 
    "ClientID": "CLIENTID",
    "ClientSecret": "CLIENTSECRET",
    "PathToPublicKey": "/path/to/your/public/key/file.pem",
    //"PublicKey": "ALTERNATIVE TO SPECIFYING PATH (DIRECTLY PASTE PublicKey)"
});

| Option | Default | Description | | ------------------- | ----------------------------- | ------------------------------------------------------------------------------------- | | ENV | TEST | Environment to be initialized. Can be set to TEST or PRODUCTION | | ClientID | | `ClientID` which can be generated on cashfree dashboard. | | `ClientSecret` | | ClientSecret which can be found alongside generated ClientID. | | PathToPublicKey | | Either specify the path to your `.pem` public key file or use `PublicKey` Param and pass the key there. | | `PublicKey` | | Pass your Public Key to this parameter as an alternative to PathToPublicKey. |

WebHook Verification

To verify the webhook received from Cashfree for different events and accept the webhook only when it returns true.

Usage

Pass the webhook received along with the payload type.

Cashfree.Payouts.VerifySignature(webhookPostDataJson) // returns true or false

Using Promises

Every method returns a promise which can be used:

Payouts.Beneficiary.Add({
	"beneId": "JOHN18012", 
	"name": "john doe",
	"email": "[email protected]", 
	"phone": "9876543210", 
	"bankAccount": "00001111222233", 
	"ifsc": "HDFC0000001", 
	"address1" : "ABC Street", 
	"city": "Bangalore", 
	"state":"Karnataka", 
	"pincode": "560001"
}).then(function(res){
	console.log(res)
});

Using Async/Await

Can also be used synchronously using async/await:

var syncCall = async function (){
	var res = await Payouts.Beneficiary.Add({
		"beneId": "JOHN18012", 
		"name": "john doe",
		"email": "[email protected]", 
		"phone": "9876543210", 
		"bankAccount": "00001111222233", 
		"ifsc": "HDFC0000001", 
		"address1" : "ABC Street", 
		"city": "Bangalore", 
		"state":"Karnataka", 
		"pincode": "560001"
	});
	return res;
}
syncCall();
  • For more information about the APIs go to Payouts.
  • Complete list of APIs.

TODO

  • PG

  • Market Place

  • Autocollect