added seprate forwardrequest code and added find things by clientReqId

This commit is contained in:
Lincpay Tech
2025-11-20 18:58:58 +05:30
parent 23050efbdc
commit 3322645ab1
23 changed files with 558 additions and 48 deletions
@@ -39,18 +39,19 @@ public class BBPSConstant {
public static final String CUSTOMPARAM_URL = "/customerParam?billerId=";
public static final String BILL_FETCH_INTI = "/couapp/bills/fetch";
public static final String BILL_FETCH_BY_ID = "/couapp/bills/fetch/byId?billId=";
public static final String BILL_FETCH_BY_CLIENT_REQ_ID = "/couapp/bills/fetch/byClientId?clientReqId=";
public static final String BILL_VALIDATE_BY_CLIENT_REQ_ID = "/couapp/bills/validate/byClientId?clientReqId=";
public static final String PAYMENT_URL = "/agent/bills/payment";
public static final String CHECK_TRANSACTION_URL = "/transactions/payment/byTxnId?txnId=";
public static final String CHECK_TRANSACTION_BY_CLIENT_REQ_ID_URL = "/transactions/payment/byClientId?clientReqId=";
public static final String DISPOSTION_URL = "/disposition";
public static final String COMPALINT_STATUS = "/couapp/complaints/status";
public static final String REOPEN_COMPALINT = "/couapp/complaints/reopen";
public static final String COMPLAINT_HISTORY = "/couapp/complaints/history/byId?complaintId=";
public static final String CLOSE_COMPLAINT = " /couapp/complaints/closure";
public static final String VIEW_COMPLAINT_BY_ID = "/couapp/complaints/byId?complaintId=";
public static final String PLANS_URL = "/plans";
public static final String ADD_COMPLAIN_ENDPOINT = "/couapp/complaints";
public static final String VIEW_ALL_COMPLAINTS_BASE = "/couapp/complaints/all";
}
@@ -1,5 +1,7 @@
package com.billpaymentservice.bbps.util;
import com.billpaymentservice.bbps.dto.request.FetchBillRequest;
import com.billpaymentservice.bbps.dto.sentRequest.FetchBillForwardRequest;
import com.billpaymentservice.bbps.entites.BillerDetails;
import com.billpaymentservice.bbps.entites.BillerResponseParams;
import com.billpaymentservice.bbps.entites.InterchangeFee;
@@ -34,6 +36,7 @@ public class EntityRelationshipUtil {
if (entity.getBillerAdditionalInfos() != null) {
entity.getBillerAdditionalInfos().forEach(a -> a.setBiller(entity));
}
if (entity.getInterchangeFees() != null) {
for (InterchangeFee fee : entity.getInterchangeFees()) {
@@ -88,6 +91,25 @@ public class EntityRelationshipUtil {
});
}
}
public static FetchBillForwardRequest map(FetchBillRequest req) {
FetchBillForwardRequest forward = new FetchBillForwardRequest();
forward.setBillerId(req.getBillerId());
forward.setBillerName(req.getBillerName());
forward.setBillerCategory(req.getBillerCategory());
forward.setClientReqId(req.getClientReqId());
forward.setMacAdress(req.getMacAdress());
forward.setCustomerMobNo(req.getCustomerMobNo());
forward.setRemitterName(req.getRemitterName());
forward.setPaymentChannel(req.getPaymentChannel());
forward.setDeviceBlockTags(req.getDeviceBlockTags());
forward.setCustomerParamsRequest(req.getCustomerParamsRequest());
forward.setRemitterIdentity(req.getRemitterIdentity());
return forward;
}
}
@@ -17,8 +17,14 @@ import com.billpaymentservice.bbps.dto.AdditionalInfoBillDTO;
import com.billpaymentservice.bbps.dto.CustomerParamDAO;
import com.billpaymentservice.bbps.dto.ResponseModel;
import com.billpaymentservice.bbps.dto.request.BillFetchByBillIdRequest;
import com.billpaymentservice.bbps.dto.request.BillPaymentRequest;
import com.billpaymentservice.bbps.dto.request.FetchBillRequest;
import com.billpaymentservice.bbps.dto.request.FetchBillValidatestRequest;
import com.billpaymentservice.bbps.dto.response.BillDataResponse;
import com.billpaymentservice.bbps.dto.response.FetchBillValidateResponse;
import com.billpaymentservice.bbps.dto.sentRequest.BillPaymentForwardRequest;
import com.billpaymentservice.bbps.dto.sentRequest.FetchBillForwardRequest;
import com.billpaymentservice.bbps.dto.sentRequest.FetchBillValidatestForwardRequest;
import com.billpaymentservice.bbps.entites.AdditionalInfoBill;
import com.billpaymentservice.bbps.entites.BBPSMastersData;
import com.billpaymentservice.bbps.entites.BillMaster;
@@ -204,6 +210,7 @@ public class Helper {
outboundLog.setResponsePayload(responsePayload);
outboundLog.setResponseReceiveTime(LocalDateTime.now());
outboundTraceLogRepository.save(outboundLog);
}
/* ---------- End helpers ---------- */
public void saveOrUpdateBillerData(BillerDetails newEntity) {
@@ -244,20 +251,20 @@ public class Helper {
}
}
public void saveOrUpdateBillerData(BillDataResponse responseWrapper,
BillFetchByBillIdRequest billFetchByBillIdRequest) {
public void saveOrUpdateBillData(BillDataResponse responseWrapper,
BillFetchByBillIdRequest billFetchByBillIdRequest,String txnId) {
BillMaster billMaster = new BillMaster();
billMaster.setBillId("12333333hjsdfjsfdj");
billMaster.setBillId(billFetchByBillIdRequest.getBillId());
billMaster.setRefId(responseWrapper.getRefId());
billMaster.setBillerId(responseWrapper.getBillerId());
billMaster.setStatus(responseWrapper.getStatus());
billMaster.setActionType(responseWrapper.getActionType());
billMaster.setUserId(responseWrapper.getUserId());
billMaster.setReqId(billFetchByBillIdRequest.getReqId());
billMaster.setTxnId("jhnjhbhj");
billMaster.setTxnId(txnId);
// BILLER RESPONSE
@@ -354,4 +361,65 @@ billMasterRepository.save(billMaster);
}
public FetchBillForwardRequest fetchBillForwardRequestMap(FetchBillRequest req) {
FetchBillForwardRequest forward = new FetchBillForwardRequest();
forward.setBillerId(req.getBillerId());
forward.setBillerName(req.getBillerName());
forward.setBillerCategory(req.getBillerCategory());
forward.setClientReqId(req.getClientReqId());
forward.setMacAdress(req.getMacAdress());
forward.setCustomerMobNo(req.getCustomerMobNo());
forward.setRemitterName(req.getRemitterName());
forward.setPaymentChannel(req.getPaymentChannel());
forward.setDeviceBlockTags(req.getDeviceBlockTags());
forward.setCustomerParamsRequest(req.getCustomerParamsRequest());
forward.setRemitterIdentity(req.getRemitterIdentity());
return forward;
}
public FetchBillValidatestForwardRequest fetchBillValidatestForwardRequest(FetchBillValidatestRequest req) {
FetchBillValidatestForwardRequest forward = new FetchBillValidatestForwardRequest();
forward.setBillerId(req.getBillerId());
forward.setBillerName(req.getBillerName());
forward.setBillerCategory(req.getBillerCategory());
forward.setCustomerMobNo(req.getCustomerMobNo());
forward.setClientReqId(req.getClientReqId());
forward.setMacAddress(req.getMacAddress());
forward.setCustomerParamsRequest(req.getCustomerParamsRequest());
return forward;
}
public BillPaymentForwardRequest billPaymentForwardRequest(BillPaymentRequest req) {
BillPaymentForwardRequest forward = new BillPaymentForwardRequest();
forward.setTenantId(req.getTenantId());
forward.setRefId(req.getRefId());
forward.setBillId(req.getBillId());
forward.setAmountOptions(req.isAmountOptions());
forward.setPaymentMode(req.getPaymentMode());
forward.setPaymentInformation(req.getPaymentInformation());
forward.setBillerId(req.getBillerId());
forward.setBillerName(req.getBillerName());
forward.setBillerCategory(req.getBillerCategory());
forward.setMacAdress(req.getMacAdress());
forward.setCustomerMobNo(req.getCustomerMobNo());
forward.setTxnAmount(req.getTxnAmount());
forward.setPaymentRefId(req.getPaymentRefId());
forward.setClientReqId(req.getClientReqId());
forward.setPaymentChannel(req.getPaymentChannel());
forward.setDeviceBlockTags(req.getDeviceBlockTags());
forward.setCustomerParamsRequest(req.getCustomerParamsRequest());
forward.setRemitterIdentity(req.getRemitterIdentity());
forward.setAmountBreakSet(req.getAmountBreakSet());
return forward;
}
}