Commit e7d6beeedb7474229261f8c67532547cc45cbb3e

Authored by Adhidarma Hadiwinoto
1 parent f855f4fdca
Exists in master

message using stringify

Showing 2 changed files with 4 additions and 2 deletions Side-by-side Diff

... ... @@ -7,6 +7,7 @@ const url = require('url');
7 7 const https = require('https');
8 8 const xmlrpc = require('xmlrpc');
9 9 const moment = require('moment');
  10 +const stringify = require("json-stringify-pretty-compact");
10 11  
11 12 const config = require('komodo-sdk/config');
12 13 const logger = require('komodo-sdk/logger');
... ... @@ -90,7 +91,7 @@ function _topUpRequest(task, isAdvice) {
90 91 report({
91 92 trx_id: task.trx_id,
92 93 rc: partnerRc[value.RESPONSECODE] || '40',
93   - message: value.MESSAGE,
  94 + message: stringify(value),
94 95 sn: (value.SN || '').replace(/;$/, '') || st24.extractSnFromMessage(value.MESSAGE),
95 96 amount: value.PRICE || st24.extractPriceFromMsg(value.MESSAGE),
96 97 raw: value,
... ... @@ -138,7 +139,7 @@ function _topUpInquiry(task) {
138 139 report({
139 140 trx_id: task.trx_id,
140 141 rc: partnerRc[value.RESPONSECODE] || '40',
141   - message: value.MESSAGE,
  142 + message: stringify(value),
142 143 sn: (value.SN || '').replace(/;$/, '') || st24.extractSnFromMessage(value.MESSAGE, config.sn_pattern),
143 144 amount: value.PRICE || st24.extractPriceFromMsg(value.MESSAGE),
144 145 raw: value,
... ... @@ -22,6 +22,7 @@
22 22 "author": "Adhidarma Hadiwinoto <me@adhisimon.org>",
23 23 "license": "ISC",
24 24 "dependencies": {
  25 + "json-stringify-pretty-compact": "^1.1.0",
25 26 "komodo-sdk": "git+http://gitlab.kodesumber.com/komodo/komodo-sdk.git",
26 27 "moment": "^2.22.1",
27 28 "xmlrpc": "^1.3.2"