|
361 | 361 |
|
362 | 362 | this.merchantConfig = new AuthenticationSDK.MerchantConfig(configObject); |
363 | 363 | this.constants = AuthenticationSDK.Constants; |
| 364 | + this.basePath = this.constants.HTTP_URL_PREFIX + this.merchantConfig.getRequestHost(); |
364 | 365 | this.logger = AuthenticationSDK.Logger.getLogger(this.merchantConfig); |
365 | 366 | } |
366 | 367 |
|
|
377 | 378 | this.merchantConfig.setRequestType(httpMethod) |
378 | 379 | this.merchantConfig.setRequestJsonData(requestBody); |
379 | 380 |
|
380 | | - this.logger.info("Authentication Type : " + this.merchantConfig.getAuthenticationType()); |
| 381 | + this.logger.info('Authentication Type : ' + this.merchantConfig.getAuthenticationType()); |
381 | 382 | this.logger.info(this.constants.REQUEST_TYPE + ' : ' + httpMethod.toUpperCase()); |
382 | 383 |
|
383 | 384 | var token = AuthenticationSDK.Authorization.getToken(this.merchantConfig, this.logger); |
384 | 385 |
|
385 | | - if (this.merchantConfig.getAuthenticationType() === this.constants.JWT) { |
386 | | - token = "Bearer " + token; |
| 386 | + if (this.merchantConfig.getAuthenticationType().toLowerCase() === this.constants.JWT) { |
| 387 | + token = 'Bearer ' + token; |
387 | 388 | headerParams['Authorization'] = token; |
388 | 389 | this.logger.info(this.constants.AUTHORIZATION + ' : ' + token); |
389 | 390 | } |
390 | | - else if (this.merchantConfig.getAuthenticationType() === this.constants.HTTP) { |
| 391 | + else if (this.merchantConfig.getAuthenticationType().toLowerCase() === this.constants.HTTP) { |
391 | 392 | var date = new Date(Date.now()).toUTCString(); |
392 | 393 |
|
393 | 394 | if (httpMethod.toLowerCase() === this.constants.POST |
|
405 | 406 | headerParams['signature'] = token; |
406 | 407 | headerParams['User-Agent'] = this.constants.USER_AGENT_VALUE; |
407 | 408 |
|
408 | | - this.logger.info("v-c-merchant-id : " + this.merchantConfig.getMerchantID()); |
409 | | - this.logger.info("date : " + date); |
410 | | - this.logger.info("host : " + this.merchantConfig.getRequestHost()); |
411 | | - this.logger.info("signature : " + token); |
412 | | - this.logger.info("User-Agent : " + headerParams['User-Agent']); |
| 409 | + this.logger.info('v-c-merchant-id : ' + this.merchantConfig.getMerchantID()); |
| 410 | + this.logger.info('date : ' + date); |
| 411 | + this.logger.info('host : ' + this.merchantConfig.getRequestHost()); |
| 412 | + this.logger.info('signature : ' + token); |
| 413 | + this.logger.info('User-Agent : ' + headerParams['User-Agent']); |
413 | 414 | this.logger.info(this.constants.END_TRANSACTION); |
414 | 415 | } |
415 | 416 |
|
|
0 commit comments