Commit 28604420b4c61a35f064b88271c4e6ee6453564b

Authored by Adhidarma Hadiwinoto
1 parent cf07389090
Exists in master

rapihkan log

Showing 1 changed file with 13 additions and 7 deletions Side-by-side Diff

... ... @@ -110,17 +110,17 @@ function _topupRequest(task, pendingOnConnectError) {
110 110 if (error) {
111 111 var rc = '68';
112 112 var msg = 'XMLRPC Client Error: ' + error;
113   -
  113 +
114 114 if (!pendingOnConnectError && (error.code == 'ECONNREFUSED' || error.code == 'EHOSTUNREACH')) {
115 115 rc = '91';
116 116 msg = 'XMLRPC Client Error on connecting';
117 117 }
118 118  
119   - callbackReport(task['requestId'], rc, msg, null, JSON.stringify(error));
  119 + callbackReport(task['requestId'], rc, msg, null, JSON.stringify({methodName: methodName, error: error}));
120 120 return;
121 121 }
122 122  
123   - logger.info('Got XMLRPC response from partner for', {response_method: methodName, response_message: value});
  123 + logger.info('Got XMLRPC response from partner for', {methodName: methodName, response_message: value});
124 124  
125 125 if (value['RESPONSECODE'] == '94') {
126 126 logger.info('Change RC 94 to 68');
... ... @@ -134,7 +134,9 @@ function _topupRequest(task, pendingOnConnectError) {
134 134 value['MESSAGE'] = 'SN=' + parseSN(value['MESSAGE']) + '; ' + value['MESSAGE'];
135 135 }
136 136  
137   - callbackReport(value['REQUESTID'], value['RESPONSECODE'], value['MESSAGE'], null, JSON.stringify(value));
  137 + callbackReport(
  138 + value['REQUESTID'], value['RESPONSECODE'], value['MESSAGE'], null, JSON.stringify({methodName: methodName, response: value})
  139 + );
138 140 });
139 141 }
140 142  
... ... @@ -168,7 +170,9 @@ function createServer() {
168 170 value['MESSAGE'] = 'SN=' + parseSN(value['MESSAGE']) + '; ' + value['MESSAGE'];
169 171 }
170 172  
171   - callbackReport(value['REQUESTID'], value['RESPONSECODE'], value['MESSAGE'], null, JSON.stringify(value));
  173 + callbackReport(
  174 + value['REQUESTID'], value['RESPONSECODE'], value['MESSAGE'], null, JSON.stringify({methodName: 'topUpReport', msg: value})
  175 + );
172 176 }
173 177  
174 178 callback(null, 'ACK REPORT OK');
... ... @@ -249,12 +253,14 @@ function checkStatus(task) {
249 253 // Results of the method response
250 254 if (error) {
251 255 logger.warn('Error requesting topUpInquiry: ', {err: error, params: params});
252   - callbackReport(task.requestId, '68', 'Error requesting topUpInquiry: ' + error, null, JSON.stringify(error));
  256 + callbackReport(
  257 + task.requestId, '68', 'Error requesting topUpInquiry: ' + error, null, JSON.stringify({methodName: methodName, error: error})
  258 + );
253 259 return;
254 260 }
255 261 logger.info('Method response for \'' + methodName, {response: value});
256 262  
257   - callbackReport(task.requestId, value['RESPONSECODE'], value['MESSAGE'], null, JSON.stringify(value));
  263 + callbackReport(task.requestId, value['RESPONSECODE'], value['MESSAGE'], null, JSON.stringify({methodName: methodName, response: value}));
258 264 });
259 265 }
260 266