diff --git a/partner-trugee.js b/partner-trugee.js index 6f49908..762fef3 100644 --- a/partner-trugee.js +++ b/partner-trugee.js @@ -61,10 +61,8 @@ function topupRequest(task, retry) { var payload_xml = createPayload(task); //console.log(payload_xml); - var postRequest = { - host: "202.152.62.2", - path: "/RELOAD97.php", - port: 7713, + var request_options = { + url: config.h2h_out.partner, method: "POST", headers: { 'Content-Type': 'text/xml', @@ -73,7 +71,7 @@ function topupRequest(task, retry) { }; var buffer = ""; - var req = http.request( postRequest, function( res ) { + var req = http.request(request_options, function( res ) { console.log('Status code: ' + res.statusCode ); var buffer = ""; @@ -94,6 +92,8 @@ function topupRequest(task, retry) { } function topupResponseHandler(body, request_id) { + console.log(body); + return; xml2js(body, function (err, result) { if (err) { console.log(body); @@ -137,19 +137,6 @@ function topupResponseHandler(body, request_id) { var sn = parseSN(message); console.log ('SN Operator: ' + sn); - /* - if (!sn) { - - console.log('Missing real operator SN, using SN from suplier'); - try { - sn = result.datacell.trxid[0].trim(); - } - catch(err) { - sn = ''; - } - } - */ - if (sn) { message = 'SN=' + sn + '; ' + message; } else {