[javascript] IPN notification Receiver [ Node js ]

Viewer

copydownloadembedprintName: IPN notification Receiver [ Node js ]
  1. /*
  2. packages needed are  
  3.  
  4. $ npm install express@">=3.0.0 <4.0.0" --save
  5. $ npm install fs
  6.  
  7. run this file and use the IPN url as http://localhost:3000
  8.  
  9. in the place of localhost put your server IP address.
  10.  
  11. example : http://185.65.20.361:3000
  12.  
  13. */
  14.  
  15.  
  16.  
  17. var express = require('express')
  18. var fs = require('fs')
  19. var app = express()
  20.  
  21. app.use(express.bodyParser())
  22.  
  23. app.post('/', function(request, response) {
  24.  
  25.   var address = request.body.address
  26.   var label =   request.body.lable
  27.   var currency = request.body.currency
  28.   var txid = request.body.txid
  29.   var amount = request.body.amount
  30.  
  31. //above i have defined all the varible you can use them anyway you want
  32.  
  33.   response.writeHead(200, {'Content-Type': 'text/html'})
  34.   response.end('got new IPN successfully')
  35. })
  36.  
  37. const port = 3000
  38. app.listen(port)
  39. console.log("Listening on port {port}")
  40.  

Editor

You can edit this paste and save as new:


File Description
  • IPN notification Receiver [ Node js ]
  • Paste Code
  • 20 Sep-2021
  • 870 Bytes
You can Share it: