update complaint

This commit is contained in:
Mohd-Arham
2025-12-08 10:05:29 +05:30
parent 1e38efe3c0
commit 7e7b8ae9cf
12 changed files with 92 additions and 29 deletions
@@ -5,6 +5,7 @@ import java.time.LocalDateTime;
import java.util.Date;
import java.util.Random;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpHeaders;
@@ -71,19 +72,20 @@ public class Helper {
BBPSMastersData merchantValidation = bbpsMasterDataRepo.findByMid(mid);
if (merchantValidation == null) {
LOGGER.warn("Merchant not found for MID: {}", mid);
throw new CustomException("Merchant not found by id", "FAILED", BBPSConstant.BADREQUEST, null);
LOGGER.warn("Merchant not found for MID: {}", mid);
throw new CustomException("Merchant not found by id", "FAILED", BBPSConstant.BADREQUEST, null);
}
if (merchantValidation.getApiKey() == null && merchantValidation.getSecreteKey() == null) {
LOGGER.warn("Merchant BBPS service is not active MID: {}", mid);
throw new CustomException("Merchant BBPS Service is not active by mid", "FAILED", BBPSConstant.BADREQUEST,
null);
}
if (StringUtils.isBlank(merchantValidation.getApiKey())
&& StringUtils.isBlank(merchantValidation.getSecreteKey())) {
LOGGER.warn("Merchant BBPS service is not active MID: {}", mid);
throw new CustomException("Merchant BBPS Service is not active by mid",
"FAILED", BBPSConstant.BADREQUEST, null);
}
if (!Boolean.TRUE.equals(merchantValidation.getIsActive())) {
LOGGER.warn("Merchant inactive for MID: {}", mid);
throw new CustomException("Merchant is inactive", "FAILED", BBPSConstant.BADREQUEST, null);
LOGGER.warn("Merchant inactive for MID: {}", mid);
throw new CustomException("Merchant is inactive", "FAILED", BBPSConstant.BADREQUEST, null);
}
LOGGER.info("Merchant is valid and active for MID: {}", mid);