All Projects β†’ sslcommerz β†’ SSLCommerz-NodeJS

sslcommerz / SSLCommerz-NodeJS

Licence: other
SSLCOMMERZ is a bangladeshi payment gateway provider. This is Node module for SSLCOMMERZ.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to SSLCommerz-NodeJS

mern-boilerplate
React + Express + Webpack + Mongo = MERN Stack Boilerplate
Stars: ✭ 39 (+44.44%)
Mutual labels:  express-js
boilerplate-express-api
πŸ”‹Boilerplate Express API w/ Support for ES6 Features
Stars: ✭ 22 (-18.52%)
Mutual labels:  express-js
kontent-boilerplate-express-apollo
Kontent Boilerplate for development of Express application using Apollo server and GraphQL.
Stars: ✭ 21 (-22.22%)
Mutual labels:  express-js
laravelbdsms
Xenon\LaravelBDSms is a sms gateway package for sending text message to Bangladeshi mobile numbers using several gateways like sslcommerz, greenweb, dianahost, metronet,boomcast, bulksmsbd, banglalink from Laravel framework
Stars: ✭ 68 (+151.85%)
Mutual labels:  sslcommerz
ExpressJS-SocketIO-Boilerplate
πŸ“¦ Simple Express.js & Socket.io Boilerplate
Stars: ✭ 31 (+14.81%)
Mutual labels:  express-js
reddit-clone
A reddit clone written using node.js / express.js / mongodb / passport.js. https://seiya-beddit.herokuapp.com/
Stars: ✭ 84 (+211.11%)
Mutual labels:  express-js
BotBlock.org
BotBlock - The List of Discord Bot Lists and Services
Stars: ✭ 29 (+7.41%)
Mutual labels:  express-js
TODO-List-Tech-Module
TODO List (in C#, Java, JS and PHP) - Exam Preparation for the Tech Module @ SoftUni (August 2017)
Stars: ✭ 13 (-51.85%)
Mutual labels:  express-js
MERN-Ecommerce
An E-commerce app built using MERN stack. It has 4 social login options and implements email verification as well. Stripe and Paypal payment gateways are implemented.
Stars: ✭ 50 (+85.19%)
Mutual labels:  express-js
moesif-nodejs
Moesif Nodejs Middleware Library (formerly Moesif-Express)
Stars: ✭ 36 (+33.33%)
Mutual labels:  express-js
peasy-js-samples
Showcases business logic built with peasy-js and consumed by multiple clients
Stars: ✭ 19 (-29.63%)
Mutual labels:  express-js
express-boilerplate
ExpressJS boilerplate with Socket.IO, Mongoose for scalable projects.
Stars: ✭ 83 (+207.41%)
Mutual labels:  express-js
express-keenio
πŸ“Š Rapidly install analytics with a middleware.
Stars: ✭ 42 (+55.56%)
Mutual labels:  express-js
Blogfy API
πŸš€ (WORK IN PROGRESS) Blogfy: API - A simple and ready-to-use Blog CMS for people who just want to write articles without worrying about tech stuff! Watch the project development live on twitch: twitch.tv/wilsonnetodev
Stars: ✭ 21 (-22.22%)
Mutual labels:  express-js
beat
Server framework to create fast and lightweight projects
Stars: ✭ 12 (-55.56%)
Mutual labels:  express-js
gancio
a shared agenda for local communities (with activitypub support)
Stars: ✭ 21 (-22.22%)
Mutual labels:  express-js
bdapis
Rest API service. Build with NodeJS, Express, MongoDB
Stars: ✭ 65 (+140.74%)
Mutual labels:  express-js
getmein-web
Portal to get an invite to IIITV GitHub organization
Stars: ✭ 26 (-3.7%)
Mutual labels:  express-js
MERN-BUS-APP
This is a MFRP (My first Real Project) assigned to me during my internship at Cognizant. Made with MERN Stack technology.
Stars: ✭ 92 (+240.74%)
Mutual labels:  express-js
Backend-NodeJS-Golang-Interview QA
A collection of Node JS and Golang Backend interview questions please feel free to fork and contribute to this repository
Stars: ✭ 122 (+351.85%)
Mutual labels:  express-js

SSLCommerz - Node.js Library

LTS package, Officially supported by SSLCommerz Integration Team.

Installation

npm i sslcommerz-lts

How to use:

Initialize a Transaction

const express = require('express')
const app = express()

const SSLCommerzPayment = require('sslcommerz-lts')
const store_id = '<your_store_id>'
const store_passwd = '<your_store_password>'
const is_live = false //true for live, false for sandbox

const port = 3030

//sslcommerz init
app.get('/init', (req, res) => {
    const data = {
        total_amount: 100,
        currency: 'BDT',
        tran_id: 'REF123', // use unique tran_id for each api call
        success_url: 'http://localhost:3030/success',
        fail_url: 'http://localhost:3030/fail',
        cancel_url: 'http://localhost:3030/cancel',
        ipn_url: 'http://localhost:3030/ipn',
        shipping_method: 'Courier',
        product_name: 'Computer.',
        product_category: 'Electronic',
        product_profile: 'general',
        cus_name: 'Customer Name',
        cus_email: '[email protected]',
        cus_add1: 'Dhaka',
        cus_add2: 'Dhaka',
        cus_city: 'Dhaka',
        cus_state: 'Dhaka',
        cus_postcode: '1000',
        cus_country: 'Bangladesh',
        cus_phone: '01711111111',
        cus_fax: '01711111111',
        ship_name: 'Customer Name',
        ship_add1: 'Dhaka',
        ship_add2: 'Dhaka',
        ship_city: 'Dhaka',
        ship_state: 'Dhaka',
        ship_postcode: 1000,
        ship_country: 'Bangladesh',
    };
    const sslcz = new SSLCommerzPayment(store_id, store_passwd, is_live)
    sslcz.init(data).then(apiResponse => {
        // Redirect the user to payment gateway
        let GatewayPageURL = apiResponse.GatewayPageURL
        res.redirect(GatewayPageURL)
        console.log('Redirecting to: ', GatewayPageURL)
    });
})

app.listen(port, () => {
    console.log(`Example app listening at http://localhost:${port}`)
})

Validate after successful transaction (inside success and ipn controller methods)

//sslcommerz validation 

app.get('/validate', (req, res) => {
    const data = {
        val_id:ADGAHHGDAKJ456454 //that you go from sslcommerz response
    };
    const sslcz = new SSLCommerzPayment(store_id, store_passwd, is_live)
    sslcz.validate(data).then(data => {
        //process the response that got from sslcommerz 
       // https://developer.sslcommerz.com/doc/v4/#order-validation-api
    });
}) 

To initiate a refund through API

//SSLCommerz initiateRefund

app.get('/initiate-refund', (req, res) => {
    const data = {
        refund_amount:10,
        refund_remarks:'',
        bank_tran_id:CB5464321445456456,
        refe_id:EASY5645415455,
    };
    const sslcz = new SSLCommerzPayment(store_id, store_passwd, is_live)
    sslcz.initiateRefund(data).then(data => {
        //process the response that got from sslcommerz 
        //https://developer.sslcommerz.com/doc/v4/#initiate-the-refund
    });
})

Query the status of a refund request

//SSLCommerz refundQuery

app.get('/refund-query', (req, res) => {
    const data = {
        refund_ref_id:SL4561445410,
    };
    const sslcz = new SSLCommerzPayment(store_id, store_passwd, is_live)
    sslcz.refundQuery(data).then(data => {
        //process the response that got from sslcommerz
        //https://developer.sslcommerz.com/doc/v4/#initiate-the-refund
    });
})

Query the status of a transaction (by Transaction ID)

//SSLCommerz transactionQueryByTransactionId
//you also use this as internal method
app.get('/transaction-query-by-transaction-id', (req, res) => {
    const data = {
        tran_id:AKHLAKJS5456454,
    };
    const sslcz = new SSLCommerzPayment(store_id, store_passwd, is_live)
    sslcz.transactionQueryByTransactionId(data).then(data => {
        //process the response that got from sslcommerz
        //https://developer.sslcommerz.com/doc/v4/#by-session-id
    });
})

Query the status of a transaction (by session ID)

//SSLCommerz transactionQueryBySessionId
//you also use this as internal method
app.get('/transaction-query-by-session-id', (req, res) => {
    const data = {
        sessionkey:AKHLAKJS5456454,
    };
    const sslcz = new SSLCommerzPayment(store_id, store_passwd, is_live)
    sslcz.transactionQueryBySessionId(data).then(data => {
        //process the response that got from sslcommerz
        //https://developer.sslcommerz.com/doc/v4/#by-session-id
    });
})

Β© 2019-2021 SSLCOMMERZ ALL RIGHTS RESERVED

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].