diff --git a/config.sample.json b/config.sample.json index 3915052..f33b9c5 100644 --- a/config.sample.json +++ b/config.sample.json @@ -27,6 +27,7 @@ }, "advice_max_age_ms": 0, "advice_is_topuprequest": false, + "responsecode_tag": null, "do_not_verbose_log_report": true, "force_all_to_pending": false } diff --git a/examples/kopnus/config.json b/examples/kopnus/config.json index 52af778..96dd566 100644 --- a/examples/kopnus/config.json +++ b/examples/kopnus/config.json @@ -12,5 +12,6 @@ "S20": "3023092" }, "advice_max_age_ms": 240000, - "advice_is_topuprequest": true + "advice_is_topuprequest": true, + "responsecode_tag": "RESPONCODE" } diff --git a/lib/partner.js b/lib/partner.js index 46da8e9..a7707f7 100644 --- a/lib/partner.js +++ b/lib/partner.js @@ -89,9 +89,11 @@ function _topUpRequest(task, isAdvice) { logger.info('Got XMLRPC response from partner for', {method: xmlrpcMethod, trx_id: task.trx_id, destination: task.destination, response: value}); matrix.last_topupRequest_ack = value; + const RESPONSECODE_TAG = config.responsecode_tag ? config.responsecode_tag : 'RESPONSECODE'; + report({ trx_id: task.trx_id, - rc: partnerRc[value.RESPONSECODE] || '40', + rc: partnerRc[value[RESPONSECODE_TAG]] || '40', message: stringify(value), sn: (value.SN || '').replace(/;$/, '') || st24.extractSnFromMessage(value.MESSAGE), amount: value.PRICE || st24.extractPriceFromMsg(value.MESSAGE),