Commit 1c840a7088350cf7b46abca18a436683a29ddcf4
1 parent
3f8e65bfd8
Exists in
master
http request to trugee
Showing 1 changed file with 5 additions and 18 deletions Side-by-side Diff
partner-trugee.js
... | ... | @@ -61,10 +61,8 @@ function topupRequest(task, retry) { |
61 | 61 | var payload_xml = createPayload(task); |
62 | 62 | //console.log(payload_xml); |
63 | 63 | |
64 | - var postRequest = { | |
65 | - host: "202.152.62.2", | |
66 | - path: "/RELOAD97.php", | |
67 | - port: 7713, | |
64 | + var request_options = { | |
65 | + url: config.h2h_out.partner, | |
68 | 66 | method: "POST", |
69 | 67 | headers: { |
70 | 68 | 'Content-Type': 'text/xml', |
... | ... | @@ -73,7 +71,7 @@ function topupRequest(task, retry) { |
73 | 71 | }; |
74 | 72 | |
75 | 73 | var buffer = ""; |
76 | - var req = http.request( postRequest, function( res ) { | |
74 | + var req = http.request(request_options, function( res ) { | |
77 | 75 | |
78 | 76 | console.log('Status code: ' + res.statusCode ); |
79 | 77 | var buffer = ""; |
... | ... | @@ -94,6 +92,8 @@ function topupRequest(task, retry) { |
94 | 92 | } |
95 | 93 | |
96 | 94 | function topupResponseHandler(body, request_id) { |
95 | + console.log(body); | |
96 | + return; | |
97 | 97 | xml2js(body, function (err, result) { |
98 | 98 | if (err) { |
99 | 99 | console.log(body); |
... | ... | @@ -137,19 +137,6 @@ function topupResponseHandler(body, request_id) { |
137 | 137 | var sn = parseSN(message); |
138 | 138 | console.log ('SN Operator: ' + sn); |
139 | 139 | |
140 | - /* | |
141 | - if (!sn) { | |
142 | - | |
143 | - console.log('Missing real operator SN, using SN from suplier'); | |
144 | - try { | |
145 | - sn = result.datacell.trxid[0].trim(); | |
146 | - } | |
147 | - catch(err) { | |
148 | - sn = ''; | |
149 | - } | |
150 | - } | |
151 | - */ | |
152 | - | |
153 | 140 | if (sn) { |
154 | 141 | message = 'SN=' + sn + '; ' + message; |
155 | 142 | } else { |