Compare View

switch
from
...
to
 
Commits (5)

Changes

Showing 3 changed files Side-by-side Diff

center/messaging/trx-center.js
... ... @@ -38,7 +38,7 @@ function onIncomingMessage(paramsFromTransport, cb) {
38 38  
39 39 }
40 40 else if (config.commands && config.commands.postpaid_pay && config.commands.postpaid_pay.indexOf(command) >= 0) {
41   - executePostpaidInquiry(paramsFromTransport, cb);
  41 + executePostpaidPay(paramsFromTransport, cb);
42 42 }
43 43 else {
44 44 executePrepaidBuy(paramsFromTransport, cb);
... ... @@ -147,7 +147,7 @@ function executePostpaidInquiry(paramsFromTransport, cb) {
147 147 }
148 148  
149 149 let requestOptions = {
150   - url: config.core_url + '/postpaid/pay',
  150 + url: config.core_url + '/postpaid/inquiry',
151 151 qs: qs
152 152 }
153 153  
... ... @@ -155,8 +155,6 @@ function executePostpaidInquiry(paramsFromTransport, cb) {
155 155 }
156 156  
157 157 function executePostpaidPay(paramsFromTransport, cb) {
158   - // INQUIRY.PLN.1234567890.PIN
159   -
160 158 let tokens = paramsFromTransport.msg.trim().split(/[\., ]+/);
161 159  
162 160 let qs = {
... ... @@ -179,7 +177,7 @@ function executePostpaidPay(paramsFromTransport, cb) {
179 177 }
180 178  
181 179 let requestOptions = {
182   - url: config.core_url + '/postpaid/inquiry',
  180 + url: config.core_url + '/postpaid/pay',
183 181 qs: qs
184 182 }
185 183  
... ... @@ -193,10 +191,10 @@ function requestToCore(requestOptions, cb) {
193 191 if (err || res.statusCode != 200) {
194 192 logger.warn('Error requesting to CORE', {module_name: module_name, method_name: 'requestToCore', requestOptions: requestOptions, err: err});
195 193 if (cb) {
196   - cb(null, {msg: 'INTERNAL ERROR'});
  194 + cb(null, {msg: requestOptions.qs.msg + ': INTERNAL ERROR'});
197 195 }
198 196 else if (transport.send) {
199   - transport.send(requestOptions.qs.terminal_name, 'INTERNAL ERROR');
  197 + transport.send(requestOptions.qs.terminal_name, requestOptions.qs.msg + ': INTERNAL ERROR');
200 198 }
201 199 return;
202 200 }
... ... @@ -32,7 +32,9 @@ function sendHeartbeat() {
32 32 }
33 33 }
34 34  
35   - request.post(requestOptions);
  35 + request.post(requestOptions, function(err, res, body) {
  36 +
  37 + });
36 38 }
37 39  
38 40 setInterval(
1 1 {
2 2 "name": "komodo-sdk",
3   - "version": "1.13.3",
  3 + "version": "1.13.4",
4 4 "description": "SDK for Komodo",
5 5 "main": "index.js",
6 6 "scripts": {