How to Integrate Paytm Test API in Node.js ? Last Updated : 26 May, 2021 Comments Improve Suggest changes Like Article Like Report Paytm stands for Pay through mobile is used for online transactions. We can integrate it with our node.js application using Paytm developer API. This API can be used for testing as well as for development purposes.  There are two methods for doing so: Test API and Production API. Production API will only work when the Merchant account is linked to a bank account. In this article, we will implement using Test API. Setting up the environment: Initialize NPM package: npm init -y Installing dependencies: npm install express ejs  app.js const express= require('express'); var app= express(); var bodyParser= require('body-parser'); const ejs= require('ejs'); app.use(express.static(__dirname + '/views')); app.engine('html', require('ejs').renderFile); app.set("view engine", "html"); app.set("views", __dirname + "/views"); app.use(bodyParser.urlencoded({extended:true})); app.use(bodyParser.json()); app.use('/', require('./routes/server')); let port = process.env.PORT || 1234; app.listen(port,()=>{ console.log("Server is started"); }); Create routes in /routes/server.js file:Create views in /views folderConnect views in app.js fileapp.use('/', require('./routes/server'));For integrating Paytm, go to paytm.com in web mode and click "Accept Payments":Choose the "Developer" option:Log in/Sign up with your Paytm account:After login, the developer dashboard will be displayed. After this, click Developer Settings:Use your Merchant ID, Merchant KEY in the node.js application.There are two methods for doing this:Test API: In testing mode.Production API: In production mode. Production mode is active only when the Merchant account is linked to his bank account.After creating an application, run the server and Enter details like Name, Email, mobile, amount, etc.In the next step, click proceeds to payment, and you will receive an OTP on your mobile number. Enter the OTP and process and your transaction will be doneWe can also pay using a Credit card, Debit card, and net banking.Place config.js file in /routes/Paytm/ folder with your mid and key. File Name : config.js JavaScript var PaytmConfig = { mid: "YOUR MERCHANT ID", key: "YOUR MERCHANT KEY", website: "WEBSTAGING", }; module.exports.PaytmConfig = PaytmConfig; Complete code is available on https://github.com/singhteekam/Paytm_Integration Comment More infoAdvertise with us Next Article How to Integrate Paytm Test API in Node.js ? S singh_teekam Follow Improve Article Tags : Web Technologies Node.js Node.js-Methods NodeJS-Questions Similar Reads How to Integrate Stripe Payment Gateway in Node.js ? Integrating Stripe in Node allows one to make and manage online payments. Stripe provides developer-friendly API to set up the payment gateway to handle secure transactions.Payment gateways help the user to make their payments. There are many payment gateways available in the market like Razorpay, G 3 min read How to Integrate Paypal in Node ? In today's digital age, online payments have become an integral part of e-commerce and web applications. Among the myriad of payment gateways available, PayPal stands out as one of the most widely used and trusted platforms. Integrating PayPal into your Node.js application can streamline the payment 5 min read How to Perform Testing in Node.js ? Testing is a method to check whether the functionality of an application is the same as expected or not. It helps to ensure that the output is the same as the required output. How Testing can be done in Node.js? There are various methods by which tasting can be done in Node.js, but one of the simple 2 min read How to Pass Node.js Output to Web Interface ? Node.js is a versatile runtime that excels at building server-side applications. One of the common use cases is to pass the output from a Node.js server to a web interface, allowing users to interact with server-generated data in a browser. This article will walk you through the process of passing N 2 min read How to Install Express in a Node Project? ExpressJS is a popular, lightweight web framework for NodeJS that simplifies the process of building web applications and APIs. It provides a robust set of features for creating server-side applications, including routing, middleware support, and easy integration with databases and other services.Be 2 min read Like