[javascript] IPN notification Receiver [ Node js ]
Viewer
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
- /*
- packages needed are
- $ npm install express@">=3.0.0 <4.0.0" --save
- $ npm install fs
- run this file and use the IPN url as http://localhost:3000
- in the place of localhost put your server IP address.
- example : http://185.65.20.361:3000
- */
- var express = require('express')
- var fs = require('fs')
- var app = express()
- var api = ""; //your doc.mrbean.dev api key
- app.use(express.bodyParser())
- app.post('/', function(request, response) {
- var address = request.body.address
- var label = request.body.lable
- var currency = request.body.currency
- var txid = request.body.txid
- var amount = request.body.amount
- var api1 = request.body.apikey
- if(api != api1){
- response.writeHead(200, {'Content-Type': 'text/html'})
- response.end('You Are not Authorised')
- }
- //above i have defined all the varible you can use them anyway you want
- response.writeHead(200, {'Content-Type': 'text/html'})
- response.end('got new IPN successfully')
- })
- const port = 3000
- app.listen(port)
- console.log("Listening on port {port}")
Editor
You can edit this paste and save as new: