{"id":10633,"date":"2024-07-08T12:16:03","date_gmt":"2024-07-08T06:31:03","guid":{"rendered":"https:\/\/nestnepal.com\/blog\/?p=10633"},"modified":"2026-06-26T06:45:50","modified_gmt":"2026-06-26T06:45:50","slug":"esewa-payment-integration-in-nodejs","status":"publish","type":"post","link":"https:\/\/nestnepal.com\/blog\/esewa-payment-integration-in-nodejs\/","title":{"rendered":"Esewa Payment Integration in Node.Js"},"content":{"rendered":"
Esewa payment integration in Node.js application offers a popular Nepalese payment gateway for users to perform transactions. In this guide, we will learn how to integrate Esewa<\/a> payment using Node.js. By Esewa payment integration in your Node.js<\/a> application using the Express.js framework, you can seamlessly handle payments, enhance user experience, and ensure that your online business transactions are reliable and secure.<\/p>\n Node.js is an open-source, cross-platform JavaScript runtime environment that allows developers to build server-side and network applications using JavaScript. Similarly, Express.js is an efficient and flexible web framework for Node.js that simplifies the development of web<\/a> applications and APIs. When it comes to payment integration, Express.js offers a streamlined approach to handle payment processing, secure transactions, and manage callback URLs.<\/p>\n Here is the step by step process on how to integrate Esewa with Node.js using Express.js framework.<\/p>\n Write the following command in your terminal to initialize Node.js project with npm<\/a> package.<\/p>\n Nodemon is a tool in Node.js based applications that automatically restarts the node application when file changes in the directory are detected. It helps in automatically restarting the server on file changes.<\/p>\n Again, you have to add dev int the script keys inside package.json,<\/p>\n In order to use Express framework, first install Express using npm command:<\/p>\n Now, write the following code inside new file name “index.js<\/strong>“. We use Express.js to create a simple server that listens on port 3000.<\/p>\nRequirements<\/h2>\n
\n
Steps for Esewa Payment Integration in Node.js<\/h2>\n
Step 1: Initialize a new Node.js project using npm package<\/h3>\n
npm init -y<\/pre>\n
Step 2: Set up a development Environment using Nodemon<\/h3>\n
npm install -d nodemon<\/pre>\n
\"scripts\": {\n\"dev\": \"nodemon index.js\"\n},<\/pre>\nStep 3: Set up backend server with Express js<\/h3>\n
npm install express<\/pre>\n
const express= require(\"express\")\nconst app=express()\napp.use(express.json())\napp.listen(3000, ()=>{\n\u00a0 \u00a0 console.log(\"Server in port 3000\")\n})\n\nWhat is 304 Status Code: How to Fix It?<\/a><\/blockquote>