{"id":14957601,"url":"https://github.com/sslcommerz/sslcommerz-nodejs","last_synced_at":"2025-09-30T04:31:43.782Z","repository":{"id":57368974,"uuid":"214795102","full_name":"sslcommerz/SSLCommerz-NodeJS","owner":"sslcommerz","description":"SSLCOMMERZ is a bangladeshi payment gateway provider. This is Node module for SSLCOMMERZ.","archived":false,"fork":true,"pushed_at":"2023-10-29T06:56:27.000Z","size":397,"stargazers_count":93,"open_issues_count":1,"forks_count":39,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-03T07:33:52.533Z","etag":null,"topics":["express-js","nodejs","sslcommerz"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"ranasl62/npm-sslcommerz","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sslcommerz.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-13T09:44:55.000Z","updated_at":"2024-12-27T20:26:22.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sslcommerz/SSLCommerz-NodeJS","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sslcommerz%2FSSLCommerz-NodeJS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sslcommerz%2FSSLCommerz-NodeJS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sslcommerz%2FSSLCommerz-NodeJS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sslcommerz%2FSSLCommerz-NodeJS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sslcommerz","download_url":"https://codeload.github.com/sslcommerz/SSLCommerz-NodeJS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234702029,"owners_count":18873818,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["express-js","nodejs","sslcommerz"],"created_at":"2024-09-24T13:15:13.475Z","updated_at":"2025-09-30T04:31:38.531Z","avatar_url":"https://github.com/sslcommerz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [SSLCommerz - Node.js Library](https://www.npmjs.com/package/sslcommerz-lts)\n\nLTS package, Officially supported by SSLCommerz Integration Team.\n\n## Installation\n\n```bash\nnpm i sslcommerz-lts\n\n```\n\n## How to use:\n\n\n### Initialize a Transaction\n```js\nconst express = require('express')\nconst app = express()\n\nconst SSLCommerzPayment = require('sslcommerz-lts')\nconst store_id = '\u003cyour_store_id\u003e'\nconst store_passwd = '\u003cyour_store_password\u003e'\nconst is_live = false //true for live, false for sandbox\n\nconst port = 3030\n\n//sslcommerz init\napp.get('/init', (req, res) =\u003e {\n    const data = {\n        total_amount: 100,\n        currency: 'BDT',\n        tran_id: 'REF123', // use unique tran_id for each api call\n        success_url: 'http://localhost:3030/success',\n        fail_url: 'http://localhost:3030/fail',\n        cancel_url: 'http://localhost:3030/cancel',\n        ipn_url: 'http://localhost:3030/ipn',\n        shipping_method: 'Courier',\n        product_name: 'Computer.',\n        product_category: 'Electronic',\n        product_profile: 'general',\n        cus_name: 'Customer Name',\n        cus_email: 'customer@example.com',\n        cus_add1: 'Dhaka',\n        cus_add2: 'Dhaka',\n        cus_city: 'Dhaka',\n        cus_state: 'Dhaka',\n        cus_postcode: '1000',\n        cus_country: 'Bangladesh',\n        cus_phone: '01711111111',\n        cus_fax: '01711111111',\n        ship_name: 'Customer Name',\n        ship_add1: 'Dhaka',\n        ship_add2: 'Dhaka',\n        ship_city: 'Dhaka',\n        ship_state: 'Dhaka',\n        ship_postcode: 1000,\n        ship_country: 'Bangladesh',\n    };\n    const sslcz = new SSLCommerzPayment(store_id, store_passwd, is_live)\n    sslcz.init(data).then(apiResponse =\u003e {\n        // Redirect the user to payment gateway\n        let GatewayPageURL = apiResponse.GatewayPageURL\n        res.redirect(GatewayPageURL)\n        console.log('Redirecting to: ', GatewayPageURL)\n    });\n})\n\napp.listen(port, () =\u003e {\n    console.log(`Example app listening at http://localhost:${port}`)\n})\n```\n\n### Validate after successful transaction (inside success and ipn controller methods)\n```js\n//sslcommerz validation \n\napp.get('/validate', (req, res) =\u003e {\n    const data = {\n        val_id:ADGAHHGDAKJ456454 //that you go from sslcommerz response\n    };\n    const sslcz = new SSLCommerzPayment(store_id, store_passwd, is_live)\n    sslcz.validate(data).then(data =\u003e {\n        //process the response that got from sslcommerz \n       // https://developer.sslcommerz.com/doc/v4/#order-validation-api\n    });\n}) \n```\n\n### To initiate a refund through API\n```js\n//SSLCommerz initiateRefund\n\napp.get('/initiate-refund', (req, res) =\u003e {\n    const data = {\n        refund_amount:10,\n        refund_remarks:'',\n        bank_tran_id:CB5464321445456456,\n        refe_id:EASY5645415455,\n    };\n    const sslcz = new SSLCommerzPayment(store_id, store_passwd, is_live)\n    sslcz.initiateRefund(data).then(data =\u003e {\n        //process the response that got from sslcommerz \n        //https://developer.sslcommerz.com/doc/v4/#initiate-the-refund\n    });\n})\n```\n\n### Query the status of a refund request\n```js\n//SSLCommerz refundQuery\n\napp.get('/refund-query', (req, res) =\u003e {\n    const data = {\n        refund_ref_id:SL4561445410,\n    };\n    const sslcz = new SSLCommerzPayment(store_id, store_passwd, is_live)\n    sslcz.refundQuery(data).then(data =\u003e {\n        //process the response that got from sslcommerz\n        //https://developer.sslcommerz.com/doc/v4/#initiate-the-refund\n    });\n})\n```\n\n### Query the status of a transaction (by Transaction ID)\n```js\n//SSLCommerz transactionQueryByTransactionId\n//you also use this as internal method\napp.get('/transaction-query-by-transaction-id', (req, res) =\u003e {\n    const data = {\n        tran_id:AKHLAKJS5456454,\n    };\n    const sslcz = new SSLCommerzPayment(store_id, store_passwd, is_live)\n    sslcz.transactionQueryByTransactionId(data).then(data =\u003e {\n        //process the response that got from sslcommerz\n        //https://developer.sslcommerz.com/doc/v4/#by-session-id\n    });\n})\n```\n\n### Query the status of a transaction (by session ID)\n```js\n//SSLCommerz transactionQueryBySessionId\n//you also use this as internal method\napp.get('/transaction-query-by-session-id', (req, res) =\u003e {\n    const data = {\n        sessionkey:AKHLAKJS5456454,\n    };\n    const sslcz = new SSLCommerzPayment(store_id, store_passwd, is_live)\n    sslcz.transactionQueryBySessionId(data).then(data =\u003e {\n        //process the response that got from sslcommerz\n        //https://developer.sslcommerz.com/doc/v4/#by-session-id\n    });\n})\n```\n\n- Find more details in [SSLCommerz Developer's Guide](https://developer.sslcommerz.com/)\n- For any technical queries: integration@sslcommerz.com \n\n© 2019-2021 SSLCOMMERZ ALL RIGHTS RESERVED\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsslcommerz%2Fsslcommerz-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsslcommerz%2Fsslcommerz-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsslcommerz%2Fsslcommerz-nodejs/lists"}