arham code

This commit is contained in:
Mohd-Arham
2025-11-25 17:48:08 +05:30
parent de92de7f7d
commit b28587c5fc
2 changed files with 25 additions and 20 deletions
@@ -188,8 +188,6 @@ public class MasterDataServiceImpl implements MasterDataService {
InboundTraceLog inboundLog = helper.createInboundLog(requestId, txnID, apiName, billerDetailRequest.getMid(),
BBPSConstant.HTTP_POST, requestJson);
System.out.println(billerDataRespository.findByBillerId(billerId));
OutboundTraceLog outboundLog = helper.createOutboundLog(txnID, requestId, apiName, fullUrl,
BBPSConstant.HTTP_GET, null);
LOGGER.info("Calling external API: {}", fullUrl);
@@ -301,7 +299,7 @@ public class MasterDataServiceImpl implements MasterDataService {
@Override
public ResponseModel getContactMaster(ContactMasterRequest contactMasterRequest) {
String apiName = BBPSConstant.API_FETCH_MASTER_DATA_CATEGORY_WISE;
String apiName = BBPSConstant.API_FETCH_CATEGORY_MASTER_DATA;
String requestId = contactMasterRequest.getReqId();
LOGGER.info("[{}] START | reqId={} | mid={} | category={}", apiName, requestId, contactMasterRequest.getMid(),
contactMasterRequest.getCategory());
@@ -448,7 +446,6 @@ public class MasterDataServiceImpl implements MasterDataService {
OutboundTraceLog outboundLog = helper.createOutboundLog(txnID, requestId, apiName, fullUrl,
BBPSConstant.HTTP_GET, null);
try {
LOGGER.info("Calling external API: {}", fullUrl);
Map<String, String> responseMap = httpService.getRequest(fullUrl);
@@ -644,7 +641,7 @@ public class MasterDataServiceImpl implements MasterDataService {
String fullUrl = masterRegisterUrl + BBPSConstant.PLAN_CATEGORIES + requestModel.getBillerId();
InboundTraceLog inboundLog = helper.createInboundLog(requestId, txnID, apiName, requestModel.getMid(),
BBPSConstant.HTTP_POST, helper.convertObjectToJson(requestModel));
try {
LOGGER.info("[{}] Calling External API | URL={} | Method=GET", apiName, fullUrl);
@@ -706,13 +703,14 @@ public class MasterDataServiceImpl implements MasterDataService {
helper.validateMerchant(mid);
String txnID = helper.generateTxnId(15);
String fullUrl = masterRegisterUrl + BBPSConstant.INITIATING_CHANNEL;
InboundTraceLog inboundLog = helper.createInboundLog(requestId, txnID, apiName, requestModel.getMid(), BBPSConstant.HTTP_POST,
helper.convertObjectToJson(requestModel));
InboundTraceLog inboundLog = helper.createInboundLog(requestId, txnID, apiName, requestModel.getMid(),
BBPSConstant.HTTP_POST, helper.convertObjectToJson(requestModel));
try {
LOGGER.info("[{}] Calling Master API | URL={} | Method=GET", apiName, fullUrl);
OutboundTraceLog outboundLog = helper.createOutboundLog(txnID, requestId, apiName, fullUrl, BBPSConstant.HTTP_GET, null);
OutboundTraceLog outboundLog = helper.createOutboundLog(txnID, requestId, apiName, fullUrl,
BBPSConstant.HTTP_GET, null);
LOGGER.info("Calling Master API: {}", fullUrl);
Map<String, String> apiResponse = httpService.getRequest(fullUrl);
LOGGER.info("Response" + apiResponse);
@@ -725,10 +723,12 @@ public class MasterDataServiceImpl implements MasterDataService {
});
if (!dataMap.containsKey(BBPSConstant.RESPONSE_GENERAL_RESP)) {
helper.updateInboundLogFailure(inboundLog, responseData, String.valueOf(dataMap.get(BBPSConstant.RESPONSE_STATUS_KEY)));
helper.updateInboundLogFailure(inboundLog, responseData,
String.valueOf(dataMap.get(BBPSConstant.RESPONSE_STATUS_KEY)));
throw new CustomException(String.valueOf(dataMap.get(BBPSConstant.RESPONSE_MESSAGE_KEY)), // message
String.valueOf(dataMap.get(BBPSConstant.RESPONSE_STATUS_KEY)), // status
Integer.parseInt(String.valueOf(dataMap.get(BBPSConstant.RESPONSE_STATUSCODE_KEY))), // statusCode (int)
Integer.parseInt(String.valueOf(dataMap.get(BBPSConstant.RESPONSE_STATUSCODE_KEY))), // statusCode
// (int)
String.valueOf(dataMap.get(BBPSConstant.RESPONSE_REMARKS_KEY)));
}
@@ -774,9 +774,10 @@ public class MasterDataServiceImpl implements MasterDataService {
// Convert request to JSON and create inbound & outbound logs
String requestJson = helper.convertObjectToJson(requestModel);
InboundTraceLog inboundLog = helper.createInboundLog(requestId, txnID, apiName, requestModel.getMid(), BBPSConstant.HTTP_POST,
requestJson);
OutboundTraceLog outboundLog = helper.createOutboundLog(txnID, requestId, apiName, url, BBPSConstant.HTTP_GET, null);
InboundTraceLog inboundLog = helper.createInboundLog(requestId, txnID, apiName, requestModel.getMid(),
BBPSConstant.HTTP_POST, requestJson);
OutboundTraceLog outboundLog = helper.createOutboundLog(txnID, requestId, apiName, url, BBPSConstant.HTTP_GET,
null);
try {
LOGGER.info("[{}] Calling Master API | URL={} | Method=GET", apiName, url);
Map<String, String> apiResponse = httpService.getRequest(url);
@@ -793,7 +794,8 @@ public class MasterDataServiceImpl implements MasterDataService {
if (!dataMap.containsKey(BBPSConstant.RESPONSE_GENERAL_RESP)) {
// Failure response
helper.updateInboundLogFailure(inboundLog, responseData, String.valueOf(dataMap.get(BBPSConstant.RESPONSE_STATUS_KEY)));
helper.updateInboundLogFailure(inboundLog, responseData,
String.valueOf(dataMap.get(BBPSConstant.RESPONSE_STATUS_KEY)));
throw new CustomException(String.valueOf(dataMap.get(BBPSConstant.RESPONSE_MESSAGE_KEY)),
String.valueOf(dataMap.get(BBPSConstant.RESPONSE_STATUS_KEY)),
Integer.parseInt(String.valueOf(dataMap.get(BBPSConstant.RESPONSE_STATUSCODE_KEY))),
@@ -824,7 +826,6 @@ public class MasterDataServiceImpl implements MasterDataService {
@Override
public ResponseModel getTicketDispositions(DispositionRequest dispositionDetailRequest) {
String apiName = BBPSConstant.API_GET_TICKET_DISPOSITIONS;
String requestId = dispositionDetailRequest.getReqId();
String mid = dispositionDetailRequest.getMid();
@@ -837,13 +838,14 @@ public class MasterDataServiceImpl implements MasterDataService {
InboundTraceLog inboundLog = helper.createInboundLog(requestId, txnID, apiName,
dispositionDetailRequest.getMid(), BBPSConstant.HTTP_GET, "N/A");
OutboundTraceLog outboundLog = helper.createOutboundLog(txnID, requestId, apiName, fullUrl, BBPSConstant.HTTP_GET, null);
OutboundTraceLog outboundLog = helper.createOutboundLog(txnID, requestId, apiName, fullUrl,
BBPSConstant.HTTP_GET, null);
try {
LOGGER.info("Calling external API: {}", fullUrl);
Map<String, String> responseMap = httpService.getRequest(fullUrl);
String responseData = responseMap.get(BBPSConstant.RESPONSE_DATA_KEY);
LOGGER.debug("[{}] API Response | reqId={} | data={}", apiName, requestId, responseData);
helper.updateOutboundLogResponse(outboundLog, responseData);
@@ -851,10 +853,12 @@ public class MasterDataServiceImpl implements MasterDataService {
new TypeReference<Map<String, Object>>() {
});
if (!dataMap.containsKey(BBPSConstant.RESPONSE_GENERAL_RESP)) {
helper.updateInboundLogFailure(inboundLog, responseData, String.valueOf(dataMap.get(BBPSConstant.RESPONSE_STATUS_KEY)));
helper.updateInboundLogFailure(inboundLog, responseData,
String.valueOf(dataMap.get(BBPSConstant.RESPONSE_STATUS_KEY)));
throw new CustomException(String.valueOf(dataMap.get(BBPSConstant.RESPONSE_MESSAGE_KEY)), // message
String.valueOf(dataMap.get(BBPSConstant.RESPONSE_STATUS_KEY)), // status
Integer.parseInt(String.valueOf(dataMap.get(BBPSConstant.RESPONSE_STATUSCODE_KEY))), // statusCode (int)
Integer.parseInt(String.valueOf(dataMap.get(BBPSConstant.RESPONSE_STATUSCODE_KEY))), // statusCode
// (int)
String.valueOf(dataMap.get(BBPSConstant.RESPONSE_REMARKS_KEY)));
}
@@ -93,6 +93,7 @@ public class BBPSConstant {
public static final String API_GET_BILLER_BY_ID = "GetBillerByBillerId";
public static final String API_GET_CUSTOMER_PARAM_BY_BILLER_ID = "GetCustomerParamByBillerId";
public static final String API_FETCH_MASTER_DATA_CATEGORY_WISE = "FetchMasterDataCategoryWise";
public static final String API_FETCH_CATEGORY_MASTER_DATA = "FetchContactMasterResponse";
public static final String API_FETCH_CUSTOMER_PARAM_GROUP = "FetchCustomerParamGroup";
public static final String API_FETCH_ALL_MASTER_AMOUNT_OPTION = "FetchAllMasterAmountOption";
public static final String API_FETCH_PLAN_CATEGORIES = "FetchPlanCategorie";