Commit 5735fb277d878e6c4735b9cbc587a7badf3fcfcc

Authored by Adhidarma Hadiwinoto
1 parent 4ce3f5feeb
Exists in master

config.responsecode_tag

Showing 3 changed files with 6 additions and 2 deletions Side-by-side Diff

... ... @@ -27,6 +27,7 @@
27 27 },
28 28 "advice_max_age_ms": 0,
29 29 "advice_is_topuprequest": false,
  30 + "responsecode_tag": null,
30 31 "do_not_verbose_log_report": true,
31 32 "force_all_to_pending": false
32 33 }
examples/kopnus/config.json
... ... @@ -12,5 +12,6 @@
12 12 "S20": "3023092"
13 13 },
14 14 "advice_max_age_ms": 240000,
15   - "advice_is_topuprequest": true
  15 + "advice_is_topuprequest": true,
  16 + "responsecode_tag": "RESPONCODE"
16 17 }
... ... @@ -89,9 +89,11 @@ function _topUpRequest(task, isAdvice) {
89 89 logger.info('Got XMLRPC response from partner for', {method: xmlrpcMethod, trx_id: task.trx_id, destination: task.destination, response: value});
90 90 matrix.last_topupRequest_ack = value;
91 91  
  92 + const RESPONSECODE_TAG = config.responsecode_tag ? config.responsecode_tag : 'RESPONSECODE';
  93 +
92 94 report({
93 95 trx_id: task.trx_id,
94   - rc: partnerRc[value.RESPONSECODE] || '40',
  96 + rc: partnerRc[value[RESPONSECODE_TAG]] || '40',
95 97 message: stringify(value),
96 98 sn: (value.SN || '').replace(/;$/, '') || st24.extractSnFromMessage(value.MESSAGE),
97 99 amount: value.PRICE || st24.extractPriceFromMsg(value.MESSAGE),