Commit 200f359d8a599b988f54db6f332dfc843ad8c973
1 parent
1a0a4c0bee
Exists in
master
more data on mongodb
Showing 1 changed file with 7 additions and 1 deletions Side-by-side Diff
partner-cjk.js
... | ... | @@ -183,14 +183,16 @@ function topupResponseHandler(body, task) { |
183 | 183 | |
184 | 184 | xml2js(body, function(err, result) { |
185 | 185 | var ts = strftime('%Y-%m-%d %H:%M:%S', new Date()); |
186 | - pushResponseToMongoDb(task, {ts: ts, raw: body}); | |
187 | 186 | |
188 | 187 | if (err) { |
189 | 188 | logger.warn('Got invalid XML from partner', {err: err, body: body, task: task}); |
190 | 189 | callbackReport(task.requestId, '68', body); |
190 | + | |
191 | + pushResponseToMongoDb(task, {ts: ts, raw: body}); | |
191 | 192 | return; |
192 | 193 | } |
193 | 194 | logger.info('XML message from partner', {result: result}); |
195 | + pushResponseToMongoDb(task, {ts: ts, raw: body, parsed: result}); | |
194 | 196 | |
195 | 197 | var rc = '68'; |
196 | 198 | var message = result.ciwaru.msg[0]; |
... | ... | @@ -258,6 +260,10 @@ function topupRequest(task, retry) { |
258 | 260 | if (!task.retry) { |
259 | 261 | task.retry = retry; |
260 | 262 | } |
263 | + | |
264 | + if (!task.ts) { | |
265 | + task.ts = strftime('%Y-%m-%d %H:%M:%S', new Date()); | |
266 | + } | |
261 | 267 | |
262 | 268 | var remoteProduct = task.remoteProduct.split(','); |
263 | 269 |