Commit fc07b328d278fa446c2d3a01fa09c02a98b5e958

Authored by Adhidarma Hadiwinoto
1 parent 81d009a7af
Exists in master

report full post. report get dihapus.

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

... ... @@ -88,10 +88,6 @@ function forwardCoreTaskToPartner(coreMessage) {
88 88 }
89 89  
90 90 function report(data) {
91   - reportUsingHttpPost(data);
92   -}
93   -
94   -function reportUsingHttpPost(data) {
95 91  
96 92 let core_pull_report_url;
97 93  
... ... @@ -136,46 +132,6 @@ function reportUsingHttpPost(data) {
136 132 });
137 133 }
138 134  
139   -function reportUsingHttpGet(data) {
140   - let core_pull_report_url;
141   -
142   - if (config.core_url) {
143   - core_pull_report_url = config.core_url + '/pull/report';
144   - } else if (config.pull_url.report) {
145   - core_pull_report_url = config.pull_url.report.replace('<CORE_APIKEY>', config.core_apikey);
146   - }
147   -
148   - if (!core_pull_report_url) {
149   - logger.warn('Unknown CORE report url');
150   - return;
151   - }
152   -
153   - let options = {
154   - url: core_pull_report_url,
155   - qs: {
156   - trx_id: data.trx_id,
157   - rc: data.rc,
158   - message: data.message,
159   - handler: config.handler_name,
160   - sn: data.sn,
161   - amount: data.amount
162   - }
163   - }
164   -
165   - logger.verbose('Report to CORE using HTTP GET');
166   - request(options, function(error, response, body) {
167   - if (error) {
168   - logger.warn('Error reporting to CORE', {error: error});
169   - }
170   - else if (response.statusCode != 200) {
171   - logger.warn('CORE http response status is not 200', {requestOptions: options, http_response_status: response.statusCode});
172   - }
173   - else {
174   - logger.verbose('Report has been sent to CORE', {requestOptions: options});
175   - }
176   - });
177   -}
178   -
179 135 function resendReport(data) {
180 136 let sleepBeforeResend = 1000;
181 137 logger.verbose('Resend report to CORE in ' + sleepBeforeResend + 'ms')