Compare View

switch
from
...
to
 
Commits (2)

Changes

Showing 3 changed files Side-by-side Diff

... ... @@ -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
1 1 {
2 2 "name": "komodo-gw-st24",
3   - "version": "2.2.9",
  3 + "version": "2.2.10",
4 4 "lockfileVersion": 1,
5 5 "requires": true,
6 6 "dependencies": {
1 1 {
2 2 "name": "komodo-gw-st24",
3   - "version": "2.2.9",
  3 + "version": "2.2.10",
4 4 "description": "Komodo Gateway to ST24 XML-RPC",
5 5 "main": "index.js",
6 6 "scripts": {