Commit bdbbbf27dc4a70e46a1638454161f110aee56c01

Authored by Adhidarma Hadiwinoto
1 parent 65f444c366
Exists in master and in 1 other branch dev

TOPUP: Forward direct response

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

lib/partner-listener/routers/topup.js
... ... @@ -72,7 +72,7 @@ async function pageIndex(req, res) {
72 72  
73 73 logger.verbose('Got CORE response', { xid: res.locals.xid, err, coreResponse });
74 74  
75   - if (err) {
  75 + if (err || !coreResponse) {
76 76 logger.warn('TOPUP: ERROR on /prepaid/buy response', {
77 77 xid: res.locals.xid, err, coreResponseTypeof: typeof coreResponse, coreResponse,
78 78 });
... ... @@ -80,7 +80,8 @@ async function pageIndex(req, res) {
80 80 return;
81 81 }
82 82  
83   - res.end('OK');
  83 + // res.end('OK');
  84 + res.json(coreResponse);
84 85 }
85 86  
86 87 // router.all('/', (req, res) => { res.status(404).end('404: Not implemented yet'); });