Tried 2 Node.js packages:
https://www.npmjs.com/package/payumoney_nodejs
https://www.npmjs.com/package/payumoney-node
Debugging on localhost.
Debugged in the index.js
file under the node_modules
in each package.
params {
key: 'x1FanfbP',
salt: 'Vs2GrDyaMQ',
service_provider: 'payu_paisa',
hash: '65f75ced566e2d76dbc6153a277c25f591fc3c0a00a8f51a0699f609d5cbbc94dc7acd5d3be5fe0c0a855c4c6dc7faef49d8b6a1d77dd09398058f800bab068d',
firstname: '',
lastname: '',
email: 'xxxxxxxx@xxxxx.xxx',
phone: XXXXXXXXXX,
amount: '100',
productinfo: '',
txnid: '5b51d253-5d6e-4512-951a-cd6d05bf9e6b',
surl: 'http://localhost:3000/member/contribution/success',
furl: 'http://localhost:3000/member/contribution/failure'
}
request.post(this.payUmoneyURL, form: params, headers: this.headers },
function(error, response, body) {
if (!error) {
var result = response.headers.location;
callback(error, result);
}
});
request.post(payment_url[this.mode] + API.makePayment, { form: params, headers: this.headers }, function(error, response, body) {
if (!error) {
var result = response.headers.location;
callback(error, result);
}
});
Response of response.headers:
response.headers {
date: 'Fri, 28 Jun 2019 12:06:35 GMT',
server: 'Apache',
'x-powered-by': 'PHP/7.2.14',
p3p: 'CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"',
'set-cookie': [ 'PHPSESSID=naopga57qf58vl0hdfj5krq4n5; path=/; domain=.payu.in' ],
expires: 'Thu, 19 Nov 1981 08:52:00 GMT',
'cache-control': 'no-store, no-cache, must-revalidate',
pragma: 'no-cache',
vary: 'Accept-Encoding',
'content-length': '3129',
connection: 'close',
'content-type': 'text/html; charset=UTF-8'
}
The above does not have location
key like response.headers.location
Can someone help to know why location
is not returned?
Is it because of development on local machine? If yes, then how to test it on localhost?
Any help is appreciated.