Commit 442388f0b247f677677dc1213d9a137b6fabd66d
1 parent
c7906ddf24
Exists in
master
Debug full endpoint url
Showing 2 changed files with 12 additions and 0 deletions Side-by-side Diff
lib/hit/dump-req-res.js
1 | 1 | const MODULE_NAME = 'DUMP-REQ-RES'; |
2 | 2 | |
3 | +const querystring = require('querystring'); | |
3 | 4 | const fs = require('fs'); |
4 | 5 | const path = require('path'); |
5 | 6 | const fsPromise = require('fs').promises; |
... | ... | @@ -52,6 +53,8 @@ ${ |
52 | 53 | ) |
53 | 54 | } |
54 | 55 | |
56 | +${httpMethod === 'GET' ? '' : `FULL URL: ${endpointUrl}?${querystring.stringify(params)}`} | |
57 | + | |
55 | 58 | RESPONSE-STATUS: ${responseStatus} |
56 | 59 | RESPONSE-BODY: |
57 | 60 | ${ |
lib/hit/prepaid-topup.js
... | ... | @@ -2,6 +2,7 @@ const MODULE_NAME = 'HIT.PREPAID-TOPUP'; |
2 | 2 | |
3 | 3 | const axios = require('axios'); |
4 | 4 | const urljoin = require('url-join'); |
5 | +const querystring = require('querystring'); | |
5 | 6 | |
6 | 7 | const config = require('komodo-sdk/config'); |
7 | 8 | const logger = require('tektrans-logger'); |
... | ... | @@ -28,6 +29,13 @@ module.exports = async (xid, task) => { |
28 | 29 | }; |
29 | 30 | |
30 | 31 | const endpointUrl = urljoin(config.partner.url, '/topup'); |
32 | + const fullEndpointUrl = urljoin( | |
33 | + endpointUrl, | |
34 | + [ | |
35 | + '?', | |
36 | + querystring.stringify(params), | |
37 | + ], | |
38 | + ); | |
31 | 39 | let lastResponse = null; |
32 | 40 | |
33 | 41 | try { |
... | ... | @@ -35,6 +43,7 @@ module.exports = async (xid, task) => { |
35 | 43 | xid, |
36 | 44 | endpointUrl, |
37 | 45 | params, |
46 | + fullEndpointUrl, | |
38 | 47 | }); |
39 | 48 | |
40 | 49 | report(xid, { |