Skip to content

Commit

Permalink
add logs to validateHash
Browse files Browse the repository at this point in the history
  • Loading branch information
jianmingtu committed Jan 20, 2024
1 parent 7ce391c commit 097cc5e
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ private URI processRequest(HttpServletRequest request) throws MissingServletRequ
if(StringUtils.isBlank(request.getParameter(Keys.PARAM_HASH_VALUE)))
throw new MissingServletRequestParameterException("hashValue","string");

logger.info("Request MerchantId = {0}", HttpServletRequestUtils.getMerchantId(request));
logger.info("Client MerchantId = {0}", clientProperty.getMerchantId());
logger.info("Client hash key = {0}", clientProperty.getGatewayHashKey());
logger.info("Request Query String = {0}", request.getQueryString());
logger.info("Request Secure Query String = {0}", getSecuredQueryString(request);
logger.info("Request hash value = {0}", request.getParameter(Keys.PARAM_HASH_VALUE));
logger.info("Client computed hash value = {0}", computeHash(getSecuredQueryString(request), clientProperty.getGatewayHashKey()));

if(!validateHash(getSecuredQueryString(request), clientProperty.getGatewayHashKey(), request.getParameter(Keys.PARAM_HASH_VALUE)))
throw new MissingServletRequestParameterException("Hash", "Hash is invalid");

Expand Down

0 comments on commit 097cc5e

Please sign in to comment.