Commit bcbd0b93fdcf823a5f240264b116e365d52b07d7

Authored by Adhidarma Hadiwinoto
1 parent ed747c16ab
Exists in master

Log balance on reverse-report irs

Showing 1 changed file with 9 additions and 1 deletions Side-by-side Diff

lib/irs/reverse-report.js
... ... @@ -41,6 +41,14 @@ function processPartnerReport(qs) {
41 41 }
42 42 }
43 43  
  44 + const balance = irs.getBalanceFromMessage(qs.msg, config.partner.balance_pattern) || null;
  45 + if (balance) {
  46 + logger.verbose('REVERSE-REPORT: Balance from supplier extracted', {
  47 + trxId: qs.clientid,
  48 + balance,
  49 + })
  50 + }
  51 +
44 52 partner.report({
45 53 trx_id: qs.clientid,
46 54 rc: rc,
... ... @@ -48,7 +56,7 @@ function processPartnerReport(qs) {
48 56 raw: stringify(qs),
49 57 sn: (qs.sn ? qs.sn : null) || irs.getSnFromMessage(qs.msg, config.partner.sn_pattern) || null,
50 58 amount: amount,
51   - balance: (rc === '00') ? irs.getBalanceFromMessage(qs.msg, config.partner.balance_pattern) : null,
  59 + balance,
52 60 misc: {}
53 61 })
54 62 }