paytm-nodejs
A Nodejs wrapper for Paytm Payment Gateway Integration
Installation
$ npm install paytm-nodejs --save
Usage
For Creating Paytm Payment
const paytm = const config = MID : '###############' // Get this from Paytm console KEY : '###############' // Get this from Paytm console ENV : 'dev' // 'dev' for development, 'prod' for production CHANNEL_ID : 'WAP' INDUSTRY : 'Retail' WEBSITE : 'Default' CALLBACK_URL : 'localhost:8080/paytm/webhook' // webhook url for verifying payment // your create payment controller functionexports{ let data = TXN_AMOUNT : reqbodyamount // request amount ORDER_ID : 'ORDER_123456' // any unique order id CUST_ID : 'CUST_123456' // any unique customer id // create Paytm Payment paytm;}
For Validating Paytm Payment
const paytm = const config = MID : '###############' // Get this from Paytm console KEY : '###############' // Get this from Paytm console ENV : 'dev' // 'dev' for development, 'prod' for production CHANNEL_ID : 'WAP' INDUSTRY : 'Retail' WEBSITE : 'Default' CALLBACK_URL : 'localhost:8080/paytm/webhook' // webhook url for verifying payment // Webhook controller functionexports{ paytm }
For Getting Order Status
const paytm = const config = MID : '###############' // Get this from Paytm console KEY : '###############' // Get this from Paytm console ENV : 'dev' // 'dev' for development, 'prod' for production CHANNEL_ID : 'WAP' INDUSTRY : 'Retail' WEBSITE : 'Default' CALLBACK_URL : 'localhost:8080/paytm/webhook' // webhook url for verifying payment paytmstatusconfig'your_order_id'{ iferr // handle err // data will contain order details }