Commit 5735fb277d878e6c4735b9cbc587a7badf3fcfcc
1 parent
4ce3f5feeb
Exists in
master
config.responsecode_tag
Showing 3 changed files with 6 additions and 2 deletions Side-by-side Diff
config.sample.json
examples/kopnus/config.json
lib/partner.js
... | ... | @@ -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), |