{"id":22147761,"url":"https://github.com/rudrodip/sslcommerz-ts","last_synced_at":"2026-05-10T07:56:59.746Z","repository":{"id":211406098,"uuid":"729030578","full_name":"rudrodip/SSLCommerz-ts","owner":"rudrodip","description":"SSLCOMMERZ is a bangladeshi payment gateway provider. This is Node module for SSLCOMMERZ with typescript support","archived":false,"fork":false,"pushed_at":"2024-01-01T16:01:04.000Z","size":80,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-15T08:55:27.935Z","etag":null,"topics":["javascript","sslcommerz","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/sslcommerz-ts","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rudrodip.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-12-08T08:47:19.000Z","updated_at":"2024-01-20T12:38:23.000Z","dependencies_parsed_at":"2023-12-08T10:30:35.270Z","dependency_job_id":"72ad962a-eb1f-44bc-b085-7910cbb2e9a1","html_url":"https://github.com/rudrodip/SSLCommerz-ts","commit_stats":null,"previous_names":["rudrodip/sslcommerz-ts"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudrodip%2FSSLCommerz-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudrodip%2FSSLCommerz-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudrodip%2FSSLCommerz-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudrodip%2FSSLCommerz-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rudrodip","download_url":"https://codeload.github.com/rudrodip/SSLCommerz-ts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245268837,"owners_count":20587681,"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":["javascript","sslcommerz","typescript"],"created_at":"2024-12-01T23:20:47.997Z","updated_at":"2025-10-07T02:52:16.707Z","avatar_url":"https://github.com/rudrodip.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [SSLCommerz - Node.js Library - Typscript](https://www.npmjs.com/package/sslcommerz-ts)\n\n## Installation\n\n```bash\nnpm i sslcommerz-ts\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-ts')\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: official.rudrodipsarker@gmail.com ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frudrodip%2Fsslcommerz-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frudrodip%2Fsslcommerz-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frudrodip%2Fsslcommerz-ts/lists"}