Commit 4e6915c9b3fb3c20122997f372dae71d3253f775
1 parent
3e0e546fc0
Exists in
master
config.partner.reverse_report_irs_using_rc_local
Showing 1 changed file with 8 additions and 5 deletions Side-by-side Diff
lib/irs/reverse-report.js
1 | -"use strict"; | |
2 | - | |
1 | +const fs = require('fs'); | |
3 | 2 | const http = require('http'); |
4 | 3 | const url = require('url'); |
5 | 4 | |
... | ... | @@ -11,12 +10,16 @@ const logger = require('komodo-sdk/logger'); |
11 | 10 | const partner = require('../partner'); |
12 | 11 | const irs = require('komodo-gw-irs-lib'); |
13 | 12 | |
13 | +const localRc = fs.existsSync(__dirname + '/../../rc-local.json') ? require('../../rc-local.json') : null; | |
14 | + | |
14 | 15 | function processPartnerReport(qs) { |
15 | 16 | let rc = '68'; |
16 | - if (qs.statuscode === '1') { | |
17 | + | |
18 | + if (config.partner.reverse_report_irs_using_rc_local && localRc && qs.statuscode) { | |
19 | + rc = localRc[qs.statuscode] || '40'; | |
20 | + } else if (qs.statuscode === '1') { | |
17 | 21 | rc = '00'; |
18 | - } | |
19 | - else if (qs.statuscode === '2') { | |
22 | + } else if (qs.statuscode === '2') { | |
20 | 23 | rc = '40'; |
21 | 24 | } |
22 | 25 |