Commit 382518d219c1b47e58af1a7f4584d6833fa30bb5

Authored by Adhidarma Hadiwinoto
1 parent 048de639b4
Exists in master

bugfix parameter get*FromResponse

Showing 1 changed file with 6 additions and 4 deletions Side-by-side Diff

... ... @@ -158,7 +158,6 @@ function topupResponseHandler(xmlResponse, _requestId, cb) {
158 158 }
159 159  
160 160 var status = getStatusFromResponse(data);
161   -
162 161 if (status == '0') {
163 162  
164 163 rc = '00';
... ... @@ -218,29 +217,32 @@ function getSnFromMessage(msg) {
218 217 }
219 218 }
220 219  
221   -function getStatusFromResponse(msg) {
  220 +function getStatusFromResponse(data) {
222 221 try {
223 222 return data.fm.status[0];
224 223 }
225 224 catch(e) {
  225 + logger.warn('Exception on getStatusFromResponse: ' + e);
226 226 return;
227 227 }
228 228 }
229 229  
230   -function getMessageFromResponse(msg) {
  230 +function getMessageFromResponse(data) {
231 231 try {
232 232 return data.fm.message[0];
233 233 }
234 234 catch(e) {
  235 + logger.warn('Exception on getMessageFromResponse: ' + e);
235 236 return;
236 237 }
237 238 }
238 239  
239   -function getRequestIdFromResponse(msg) {
  240 +function getRequestIdFromResponse(data) {
240 241 try {
241 242 return data.fm.refTrxid[0];
242 243 }
243 244 catch(e) {
  245 + logger.warn('Exception on getRequestIdFromResponse: ' + e);
244 246 return;
245 247 }
246 248 }