Compare View
Commits (2)
Changes
Showing 3 changed files Side-by-side Diff
lib/partner.js
... | ... | @@ -95,13 +95,22 @@ function _topUpRequest(task, isAdvice) { |
95 | 95 | logger.info('Got XMLRPC response from partner for', {method: xmlrpcMethod, trx_id: task.trx_id, destination: task.destination, response: value}); |
96 | 96 | matrix.last_topupRequest_ack = value; |
97 | 97 | |
98 | + const balance = st24.extractBalanceFromMsg(value.MESSAGE, config.balance_pattern) || null; | |
99 | + | |
100 | + if (balance) { | |
101 | + logger.verbose('TOPUPREQUEST: Balance from supplier extracted', { | |
102 | + trxId: task.trx_id, | |
103 | + balance, | |
104 | + }); | |
105 | + } | |
106 | + | |
98 | 107 | report({ |
99 | 108 | trx_id: task.trx_id, |
100 | 109 | rc: komodoRc(value[RESPONSECODE_TAG]) || '40', |
101 | 110 | message: 'topUpRequest: ' + stringify(value), |
102 | 111 | sn: (value.SN || '').replace(/;$/, '') || st24.extractSnFromMessage(value.MESSAGE, config.sn_pattern), |
103 | 112 | amount: value.PRICE || st24.extractPriceFromMsg(value.MESSAGE, config.amount_pattern), |
104 | - balance: st24.extractBalanceFromMsg(value.MESSAGE, config.balance_pattern), | |
113 | + balance, | |
105 | 114 | raw: value, |
106 | 115 | misc: { |
107 | 116 | task: task |
package-lock.json