I am trying to integrate payUMoney in node.js, but I am getting an error as
Mandatory parameters which must be sent in the transaction are: key, txnid, amount, productinfo, firstname, email, phone, surl, furl, hash
Mandatory parameter missing from your transaction request are: key, txnid, amount, productinfo, surl, hash, firstname, email, phone.
Here it is showing that the parameter furl is missing but I provided that. My code is as follows:
app.get('/payu',function(req,res){
var request = require('request'),
crypto=require('crypto'),
str='taO2Gy|idr001|50|test|anonymous|anonymous@gmail.com|||||||||||CMpSRcXk';
var hash = crypto.createHash('sha512');
hash.update(str);
var value = hash.digest('hex');
console.log(value);
var params={
'key':'taO2Gy',
'txnid':'idr001',
'amount':'50',
'productinfo':'test',
'firstname':'anonymous',
'email':'anonymous@gmail.com',
'phone':'9999999999',
'surl':'http://localhost:8080/',
'furl': 'http://localhost:8080/',
'curl': 'http://localhost:8080/',
'hash':value,
'service_provider':'payu_paisa'
};
request({
url:"https://test.payu.in/_payment",
method:"POST",
json:true,
body:params
}, function(err,response,body){
if(err)
console.log('Error : ' + err);
res.send(body);
});
});