{"id":20850941,"url":"https://github.com/shurjopay-plugins/sp-plugin-nodejs","last_synced_at":"2025-05-12T04:31:50.049Z","repository":{"id":114786341,"uuid":"451788079","full_name":"shurjopay-plugins/sp-plugin-nodejs","owner":"shurjopay-plugins","description":"shurjoPay plugin for nodejs applications","archived":false,"fork":false,"pushed_at":"2023-09-17T05:55:45.000Z","size":55,"stargazers_count":8,"open_issues_count":0,"forks_count":3,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-25T18:58:17.417Z","etag":null,"topics":["javascript","node","npm","payment-gateway","shurjomukhi","shurjopay","strapi-cms"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/shurjopay-plugins.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-25T08:04:59.000Z","updated_at":"2023-04-27T04:33:18.000Z","dependencies_parsed_at":"2024-11-18T08:57:00.984Z","dependency_job_id":null,"html_url":"https://github.com/shurjopay-plugins/sp-plugin-nodejs","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shurjopay-plugins%2Fsp-plugin-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shurjopay-plugins%2Fsp-plugin-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shurjopay-plugins%2Fsp-plugin-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shurjopay-plugins%2Fsp-plugin-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shurjopay-plugins","download_url":"https://codeload.github.com/shurjopay-plugins/sp-plugin-nodejs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253675408,"owners_count":21945931,"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","node","npm","payment-gateway","shurjomukhi","shurjopay","strapi-cms"],"created_at":"2024-11-18T03:11:53.610Z","updated_at":"2025-05-12T04:31:50.040Z","avatar_url":"https://github.com/shurjopay-plugins.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ![alt text](https://shurjopay.com.bd/dev/images/shurjoPay.png) Nodejs package (plugin)\n\n![Made With](https://badgen.net/badge/Made%20with/javascript)\n[![Test Status](https://github.com/rust-random/rand/workflows/Tests/badge.svg?event=push)]()\n![NPM](https://img.shields.io/npm/l/sp-plugin)\n![version](https://badgen.net/npm/v/shurjopay)\n\nOfficial shurjoPay nodejs package (plugin) for merchants or service providers to connect with shurjoPay Payment Gateway v2.1 developed and maintained by shurjoMukhi Limited.\n\nThis plugin package can be used with any nodejs application or framework .\n\nThis plugin package makes it easy for you to integrate with shurjoPay v2.1 with just three method calls:\n\n- makePayment()\n- verifyPayment()\n- paymentStatus()\n\nAlso reduces many of the things that you had to do manually\n\n- Handles http request and errors\n- JSON serialization and deserialization\n- Authentication during checkout and verification of payments\n\n## Audience\n\nThis document is intended for the developers and technical personnel of merchants and service providers who want to integrate the shurjoPay online payment gateway using python.\n\n## How to use this shurjoPay Plugin\n\n#### Use `npm` to install this plugin inside your project environment.\n\n```\nnpm install shurjopay\n```\n\n#### Create a .env file inside your project's root directory. Here is a sample .env configuration.\n\n```JavaScript\nSP_ENDPOINT=https://sandbox.shurjopayment.com\nSP_USERNAME=sp_sandbox\nSP_PASSWORD=pyyk97hu\u00266u6\nSP_PREFIX=SP\nSP_RETURN_URL=https://\u003cyour.app.com\u003e/shurjopay-response\n```\n\n#### After that, you can initiate payment request to shurjoPay using our package the way you want based on your application. Here we are providing a basic example code snippet for you.\n\n```JavaScript\nrequire(\"dotenv\").config();\nconst shurjopay = require(\"shurjopay\")();\n\n// For ES6/nextjs need to add the following lines instead of constant declaration above\nimport spfactory from 'shurjopay';\nconst shurjopay = spfactory();\n\nwith(process.env){\n  shurjopay.config(\n    SP_ENDPOINT,\n    SP_USERNAME,\n    SP_PASSWORD,\n    SP_PREFIX,\n    SP_RETURN_URL,\n  );\n\n}\n```\n\n```JavaScript\n\nshurjopay.makePayment({\n      \"amount\":1000,\n      \"order_id\":\"nx10t1\",\n      \"customer_name\":\"Shanto\",\n      \"customer_address\":\"Mohakhali\",\n      \"client_ip\": \"102.324.0.5\",\n      \"customer_phone\":\"01517162394\",\n      \"customer_city\":\"Dhaka\",\n      \"customer_post_code\":\"1229\",\n},\n(response_data) =\u003e {\n  // TODO Handle response from shurjopay and update your system\n  // NOTE 'checkout_url' in response_data can be used to redirect consumers to shurjopay landing page\n},\n(error) =\u003e {\n  // TODO Handle error response\n});\n\n```\n\n#### Payment verification can be done after each transaction with shurjopay order id.\n\n```JavaScript\n\nshurjopay.verifyPayment(order_id, (response_data) =\u003e {\n  // TODO Handle response from shurjopay and update your system\n},\n(error) =\u003e {\n  // TODO Handle error response\n});\n\n```\n\n#### That's all! Now you are ready to use the nodejs plugin to seamlessly integrate with shurjoPay to make your payment system easy and smooth.\n\n## References\n\n1. [Nodejs example application](https://github.com/shurjopay-plugins/sp-plugin-usage-examples/tree/main/node-app-node-plugin) showing usage of the nodejs plugin.\n2. [Sample applications and projects](https://github.com/shurjopay-plugins/sp-plugin-usage-examples) in many different languages and frameworks showing shurjopay integration.\n3. [shurjoPay Postman site](https://documenter.getpostman.com/view/6335853/U16dS8ig) illustrating the request and response flow using the sandbox system.\n4. [shurjopay Plugins](https://github.com/shurjopay-plugins) home page on github\n\n## License\n\nThis code is under the [MIT open source License](LICENSE).\n\n#### Please [contact](https://shurjopay.com.bd/#contacts) with shurjoPay team for more detail.\n\n### Copyright ©️2023 [ShurjoMukhi Limited](https://shurjopay.com.bd/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshurjopay-plugins%2Fsp-plugin-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshurjopay-plugins%2Fsp-plugin-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshurjopay-plugins%2Fsp-plugin-nodejs/lists"}