Commit d309c00e0878a3d0b6afe2232ccf4c5056755e2c
1 parent
7a475ed376
Exists in
master
prev balance
Showing 1 changed file with 11 additions and 1 deletions Side-by-side Diff
partner-kospinjasa.js
... | ... | @@ -78,11 +78,19 @@ function saldoCheck(callback, task) { |
78 | 78 | |
79 | 79 | if (err) { |
80 | 80 | logger.warn('Error requesting saldoCheck', {err: err}); |
81 | + callbackReport(task.requestId, '40', 'Gagal check saldo'); | |
81 | 82 | } |
82 | 83 | |
83 | 84 | var balance; |
84 | 85 | logger.verbose('saldoCheck result', {result: result}); |
85 | 86 | |
87 | + try { | |
88 | + balance = result.outputParameter.bit61.$value; | |
89 | + } | |
90 | + catch(e) { | |
91 | + balance = 'UNKNOWN'; | |
92 | + } | |
93 | + | |
86 | 94 | |
87 | 95 | if (task) { |
88 | 96 | callback(task, balance); |
... | ... | @@ -281,8 +289,10 @@ function topupResponseHandler(task, response) { |
281 | 289 | var message = message + " " + st24message; |
282 | 290 | } |
283 | 291 | |
292 | + message = message + ' -- Prev Balance: ' + balance; | |
293 | + | |
284 | 294 | logger.info('Got result: ' + message, {response: response}); |
285 | - callbackReport(task.requestId, st24rc, st24message); | |
295 | + callbackReport(task.requestId, st24rc, st24message + ' -- Prev Balance: ' + balance); | |
286 | 296 | } |
287 | 297 | |
288 | 298 | function createSignature(params, password) { |