Commit cce5494939b351f03ea53f8f0164b74707d16ba4

Authored by Adhidarma Hadiwinoto
1 parent 6f81d756b4
Exists in master

coba parse

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

... ... @@ -81,7 +81,7 @@ function topupRequest(task, retry) {
81 81 var buffer = "";
82 82 res.on( "data", function( data ) { buffer = buffer + data; } );
83 83 res.on( "end", function( data ) {
84   - topupResponseHandler(buffer);
  84 + directResponseHandler(buffer, task['requestId']);
85 85 });
86 86  
87 87 });
... ... @@ -95,6 +95,19 @@ function topupRequest(task, retry) {
95 95 req.end();
96 96 }
97 97  
  98 +function directResponseHandler(body, request_id) {
  99 + xml2js(body, function (err, result) {
  100 + if (err) {
  101 + console.log(body);
  102 + callbackReport(request_id, '40', buffer);
  103 + return;
  104 + }
  105 + console.log(result);
  106 + //request_id = result.pulsamatic.trxid;
  107 + };
  108 +
  109 +}
  110 +
98 111 function topupResponseHandler(body, request_id) {
99 112 console.log(body);
100 113 return;