From 23050efbdccae0719c6c5f074ec976625bc77b48 Mon Sep 17 00:00:00 2001 From: Lincpay Tech Date: Fri, 14 Nov 2025 16:00:25 +0530 Subject: [PATCH 1/3] saving for laptop restart --- .../bbps/controller/ComplainController.java | 8 ++ .../bbps/dto/ComplainDetailsDto.java | 3 + .../dto/request/ViewAllComplaintsRequest.java | 14 ++++ .../response/ViewAllComplaintsResponse.java | 22 ++++++ .../response/ViewComplainByIdResponse.java | 2 + .../bbps/entites/BillerDetails.java | 13 +++- .../bbps/entites/ComplaintStatusDetails.java | 9 ++- .../bbps/service/ComplainService.java | 3 + .../bbps/serviceImpl/ComplainServiceImpl.java | 76 ++++++++++++++++++- .../serviceImpl/MasterDataServiceImpl.java | 2 + .../bbps/util/BBPSConstant.java | 2 + .../bbps/util/BillerMapperHelper.java | 24 ++++++ 12 files changed, 172 insertions(+), 6 deletions(-) create mode 100644 src/main/java/com/billpaymentservice/bbps/dto/request/ViewAllComplaintsRequest.java create mode 100644 src/main/java/com/billpaymentservice/bbps/dto/response/ViewAllComplaintsResponse.java diff --git a/src/main/java/com/billpaymentservice/bbps/controller/ComplainController.java b/src/main/java/com/billpaymentservice/bbps/controller/ComplainController.java index 0c901f9..0c374c7 100644 --- a/src/main/java/com/billpaymentservice/bbps/controller/ComplainController.java +++ b/src/main/java/com/billpaymentservice/bbps/controller/ComplainController.java @@ -19,6 +19,7 @@ import com.billpaymentservice.bbps.dto.request.CloseComplaintRequest; import com.billpaymentservice.bbps.dto.request.ComplainStatusRequest; import com.billpaymentservice.bbps.dto.request.ComplaintRequestDTO; import com.billpaymentservice.bbps.dto.request.ReOpenComplain; +import com.billpaymentservice.bbps.dto.request.ViewAllComplaintsRequest; import com.billpaymentservice.bbps.dto.request.ViewComplainByIdRequest; import com.billpaymentservice.bbps.service.ComplainService; @@ -79,5 +80,12 @@ public class ComplainController { return ResponseEntity.ok(response); } + @PostMapping("/viewAllComplaints") + public ResponseEntity viewAllComplaints(@RequestBody ViewAllComplaintsRequest request) { + log.info("Received request complaint View All Complaints for Status Type={}", request.getStatusType()); + ResponseModel response = complainService.ViewAllComplaints(request); + return ResponseEntity.ok(response); + } + } diff --git a/src/main/java/com/billpaymentservice/bbps/dto/ComplainDetailsDto.java b/src/main/java/com/billpaymentservice/bbps/dto/ComplainDetailsDto.java index f9ff26f..504ef8f 100644 --- a/src/main/java/com/billpaymentservice/bbps/dto/ComplainDetailsDto.java +++ b/src/main/java/com/billpaymentservice/bbps/dto/ComplainDetailsDto.java @@ -1,10 +1,13 @@ package com.billpaymentservice.bbps.dto; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + import lombok.Getter; import lombok.Setter; @Setter @Getter +@JsonIgnoreProperties(ignoreUnknown = true) public class ComplainDetailsDto { private String complaintId; diff --git a/src/main/java/com/billpaymentservice/bbps/dto/request/ViewAllComplaintsRequest.java b/src/main/java/com/billpaymentservice/bbps/dto/request/ViewAllComplaintsRequest.java new file mode 100644 index 0000000..d7f8cb3 --- /dev/null +++ b/src/main/java/com/billpaymentservice/bbps/dto/request/ViewAllComplaintsRequest.java @@ -0,0 +1,14 @@ +package com.billpaymentservice.bbps.dto.request; + +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class ViewAllComplaintsRequest extends BaseClass{ + + private String statusType; // e.g. COMPLAINT_OPEN_SUCCESS + private Integer pageNo; // default 0 + private Integer pageSize; // default 10 + +} diff --git a/src/main/java/com/billpaymentservice/bbps/dto/response/ViewAllComplaintsResponse.java b/src/main/java/com/billpaymentservice/bbps/dto/response/ViewAllComplaintsResponse.java new file mode 100644 index 0000000..edc6dcb --- /dev/null +++ b/src/main/java/com/billpaymentservice/bbps/dto/response/ViewAllComplaintsResponse.java @@ -0,0 +1,22 @@ +package com.billpaymentservice.bbps.dto.response; + +import java.util.List; + +import com.billpaymentservice.bbps.dto.ComplainDetailsDto; +import com.billpaymentservice.bbps.dto.GeneralResp; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@JsonIgnoreProperties(ignoreUnknown = true) +public class ViewAllComplaintsResponse { + private List complaintsList; + private GeneralResp generalResp; + private Integer pageNo; + private Integer pageSize; + private Integer totalPages; + private Long totalElements; +} diff --git a/src/main/java/com/billpaymentservice/bbps/dto/response/ViewComplainByIdResponse.java b/src/main/java/com/billpaymentservice/bbps/dto/response/ViewComplainByIdResponse.java index c04a820..e981cb7 100644 --- a/src/main/java/com/billpaymentservice/bbps/dto/response/ViewComplainByIdResponse.java +++ b/src/main/java/com/billpaymentservice/bbps/dto/response/ViewComplainByIdResponse.java @@ -4,12 +4,14 @@ import java.util.List; import com.billpaymentservice.bbps.dto.GeneralResp; import com.billpaymentservice.bbps.dto.ViewComplaintDTO; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.Getter; import lombok.Setter; @Getter @Setter +@JsonIgnoreProperties(ignoreUnknown = true) public class ViewComplainByIdResponse { private List complaintsList; private GeneralResp generalResp; diff --git a/src/main/java/com/billpaymentservice/bbps/entites/BillerDetails.java b/src/main/java/com/billpaymentservice/bbps/entites/BillerDetails.java index 8849cfc..55014dd 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/BillerDetails.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/BillerDetails.java @@ -20,7 +20,18 @@ import lombok.ToString; @Getter @Setter @Entity -@ToString +@ToString(exclude = { + "billerPaymentModes", + "billerPaymentChannels", + "billerCustomerParams", + "customerParamGroups", + "billerResponseParams", + "billerAdditionalInfos", + "interchangeFeeConves", + "interchangeFees", + "billerPlanResponseParams" + }) + @Table(name = "biller_details") @JsonIgnoreProperties(ignoreUnknown = true) public class BillerDetails { diff --git a/src/main/java/com/billpaymentservice/bbps/entites/ComplaintStatusDetails.java b/src/main/java/com/billpaymentservice/bbps/entites/ComplaintStatusDetails.java index 052e134..966c3be 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/ComplaintStatusDetails.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/ComplaintStatusDetails.java @@ -11,16 +11,17 @@ import lombok.Setter; @Setter @Table(name = "complaint_status_details") public class ComplaintStatusDetails { - - - @Id + + @Id + @Column(name = "complaint_id") + private String complaintId; + @Column(name = "req_id") private String reqId; @Column(name = "txn_id") private String txnId; - private String complaintId; @Column(name = "assigned_to") private String assignedTo; diff --git a/src/main/java/com/billpaymentservice/bbps/service/ComplainService.java b/src/main/java/com/billpaymentservice/bbps/service/ComplainService.java index def76b4..4a6ad50 100644 --- a/src/main/java/com/billpaymentservice/bbps/service/ComplainService.java +++ b/src/main/java/com/billpaymentservice/bbps/service/ComplainService.java @@ -5,6 +5,7 @@ import com.billpaymentservice.bbps.dto.request.CloseComplaintRequest; import com.billpaymentservice.bbps.dto.request.ComplainStatusRequest; import com.billpaymentservice.bbps.dto.request.ReOpenComplain; import com.billpaymentservice.bbps.dto.request.TxnStatusRequest; +import com.billpaymentservice.bbps.dto.request.ViewAllComplaintsRequest; import com.billpaymentservice.bbps.dto.request.ViewComplainByIdRequest; import com.billpaymentservice.bbps.dto.request.ComplaintRequestDTO; @@ -23,5 +24,7 @@ public interface ComplainService { ResponseModel viewComplaintById(ViewComplainByIdRequest request); ResponseModel checkTxnStatus(TxnStatusRequest request); + + ResponseModel ViewAllComplaints(ViewAllComplaintsRequest request); } diff --git a/src/main/java/com/billpaymentservice/bbps/serviceImpl/ComplainServiceImpl.java b/src/main/java/com/billpaymentservice/bbps/serviceImpl/ComplainServiceImpl.java index 1759b93..c0efa0e 100644 --- a/src/main/java/com/billpaymentservice/bbps/serviceImpl/ComplainServiceImpl.java +++ b/src/main/java/com/billpaymentservice/bbps/serviceImpl/ComplainServiceImpl.java @@ -18,11 +18,13 @@ import com.billpaymentservice.bbps.dto.request.CloseComplaintRequest; import com.billpaymentservice.bbps.dto.request.ComplainStatusRequest; import com.billpaymentservice.bbps.dto.request.ReOpenComplain; import com.billpaymentservice.bbps.dto.request.TxnStatusRequest; +import com.billpaymentservice.bbps.dto.request.ViewAllComplaintsRequest; import com.billpaymentservice.bbps.dto.request.ViewComplainByIdRequest; import com.billpaymentservice.bbps.dto.response.CloseComplaintStatusResponse; import com.billpaymentservice.bbps.dto.response.ComplaintHistoryStatusResponse; import com.billpaymentservice.bbps.dto.response.ComplaintStatusResponse; import com.billpaymentservice.bbps.dto.response.TxnStatusResponse; +import com.billpaymentservice.bbps.dto.response.ViewAllComplaintsResponse; import com.billpaymentservice.bbps.dto.response.ViewComplainByIdResponse; import com.billpaymentservice.bbps.entites.BharatConnectMaster; @@ -54,7 +56,7 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; @Service -public class ComplainServiceImpl implements ComplainService { +public class ComplainServiceImpl implements ComplainService { @Value("${agent.data.url}") private String agentDtaUrl; @@ -543,4 +545,76 @@ public class ComplainServiceImpl implements ComplainService { } + @Override + public ResponseModel ViewAllComplaints(ViewAllComplaintsRequest request) { + + LOGGER.info("Fetching All Complaint for status Type={} and reqId={} ", request.getStatusType(), + request.getReqId()); + String apiName = "View All Complaint By Status Type"; + String txnId = helper.generateTxnId(15); + String reqId = request.getReqId(); + String fullUrl = complainDataUrl+ BBPSConstant.VIEW_ALL_COMPLAINTS_BASE + + "?pageNo=" + request.getPageNo() + + "&pageSize=" + request.getPageSize() + + "&statusType=" + request.getStatusType(); + + helper.validateMerchant(request.getMid()); + + BharatConnectMaster headersData = beneficiaryDetailsRepository.findByOrgId("ORG001"); + HttpHeaders headers = new HttpHeaders(); + headers.set("x-digiledge-key", headersData.getXDigiledgeKey()); + headers.set("agentId", headersData.getAgentId()); + headers.set("tenantId", headersData.getTenantId()); + headers.setContentType(MediaType.APPLICATION_JSON); + + ObjectMapper objectMapper = new ObjectMapper(); + objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + String requestJson = helper.convertObjectToJson(request); + + InboundTraceLog inboundLog = helper.createInboundLog(reqId, txnId, apiName, request.getMid(), "POST", + requestJson); + OutboundTraceLog outboundLog = helper.createOutboundLog(txnId, reqId, apiName, fullUrl, "GET", request.getStatusType()); + LOGGER.debug("Outbound log created successfully for Complaint : {}", fullUrl); + + try { + LOGGER.info("Calling external API: {}", fullUrl); + Map responseMap = httpService.getRequest(fullUrl, headers); + String responseData = responseMap.get("data"); + LOGGER.info("Response: {}", responseData); + + helper.updateOutboundLogResponse(outboundLog, responseData); + + Map dataMap = objectMapper.readValue(responseData, + new TypeReference>() { + }); + + if (!dataMap.containsKey("generalResp")) { + helper.updateInboundLogFailure(inboundLog, responseData, "INVALID_RESPONSE"); + LOGGER.warn("Invalid response structure for txnId: {}", txnId); + throw new CustomException(String.valueOf(dataMap.get("message")), String.valueOf(dataMap.get("status")), + Integer.parseInt(String.valueOf(dataMap.get("statusCode"))), String.valueOf("")); + } + + ViewAllComplaintsResponse responseWrapper = objectMapper.convertValue(dataMap, + ViewAllComplaintsResponse.class); + GeneralResp generalResp = responseWrapper.getGeneralResp(); + + String status = generalResp.getStatus(); + LOGGER.info("Current Complaint ReOpen Status: {}", status); + + helper.updateInboundLogSuccess(inboundLog, responseData, generalResp.getStatus()); + String saveComplaint = mapperHelper.saveAllComplaints(responseWrapper, reqId, txnId); + //LOGGER.info("Complaint ReOpen data saved successfully for Count History: {}", saveComplaintHistory); + + return new ResponseModel(generalResp.getMessage(), generalResp.getStatus(), + Integer.parseInt(generalResp.getStatusCode()), responseWrapper); + } catch (JsonProcessingException e) { + LOGGER.error("Error parsing Complaint Id JSON: {}", e.getMessage(), e); + helper.updateInboundLogFailure(inboundLog, e.getMessage(), "JSON_ERROR"); + throw new CustomException("Invalid JSON received from API"); + } + } + + + } diff --git a/src/main/java/com/billpaymentservice/bbps/serviceImpl/MasterDataServiceImpl.java b/src/main/java/com/billpaymentservice/bbps/serviceImpl/MasterDataServiceImpl.java index c00a6d5..04154b0 100644 --- a/src/main/java/com/billpaymentservice/bbps/serviceImpl/MasterDataServiceImpl.java +++ b/src/main/java/com/billpaymentservice/bbps/serviceImpl/MasterDataServiceImpl.java @@ -169,6 +169,8 @@ public class MasterDataServiceImpl implements MasterDataService { String requestJson = helper.convertObjectToJson(billerDetailRequest); InboundTraceLog inboundLog = helper.createInboundLog(requestId, txnID, apiName, billerDetailRequest.getMid(), "POST", requestJson); + + System.out.println( billerDataRespository.findByBillerId(billerId)); OutboundTraceLog outboundLog = helper.createOutboundLog(txnID, requestId, apiName, fullUrl, "GET", null); LOGGER.info("Calling external API: {}", fullUrl); diff --git a/src/main/java/com/billpaymentservice/bbps/util/BBPSConstant.java b/src/main/java/com/billpaymentservice/bbps/util/BBPSConstant.java index 87948db..98744dd 100644 --- a/src/main/java/com/billpaymentservice/bbps/util/BBPSConstant.java +++ b/src/main/java/com/billpaymentservice/bbps/util/BBPSConstant.java @@ -50,5 +50,7 @@ public class BBPSConstant { 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"; + } diff --git a/src/main/java/com/billpaymentservice/bbps/util/BillerMapperHelper.java b/src/main/java/com/billpaymentservice/bbps/util/BillerMapperHelper.java index be5d136..51525df 100644 --- a/src/main/java/com/billpaymentservice/bbps/util/BillerMapperHelper.java +++ b/src/main/java/com/billpaymentservice/bbps/util/BillerMapperHelper.java @@ -24,6 +24,7 @@ import com.billpaymentservice.bbps.dto.response.AmountOptionsResponse; import com.billpaymentservice.bbps.dto.response.ComplaintHistoryStatusResponse; import com.billpaymentservice.bbps.dto.response.ComplaintStatusResponse; import com.billpaymentservice.bbps.dto.response.PlanResponse; +import com.billpaymentservice.bbps.dto.response.ViewAllComplaintsResponse; import com.billpaymentservice.bbps.dto.response.ViewComplainByIdResponse; import com.billpaymentservice.bbps.entites.AdditionalInfoPlans; import com.billpaymentservice.bbps.entites.AmountOptionByBillerId; @@ -567,6 +568,29 @@ public class BillerMapperHelper { return "SUCCESS"; } + public String saveAllComplaints(ViewAllComplaintsResponse responseWrapper, String reqId, String txnId) { + + ModelMapper mapper = new ModelMapper(); + mapper.getConfiguration().setMatchingStrategy(MatchingStrategies.STRICT); + + // Map list → ComplaintStatusDetails list + List entityList = responseWrapper.getComplaintsList() + .stream() + .map(c -> mapper.map(c, ComplaintStatusDetails.class)) + .collect(Collectors.toList()); + + // Set extra fields + for (ComplaintStatusDetails entity : entityList) { + entity.setReqId(reqId); + entity.setTxnId(txnId); + } + + // Save to repository + complainDetailRepository.saveAll(entityList); + + return "SUCCESS"; + } + From 3322645ab10e5f1e5532b9449eea8b1db1ecb837 Mon Sep 17 00:00:00 2001 From: Lincpay Tech Date: Thu, 20 Nov 2025 18:58:58 +0530 Subject: [PATCH 2/3] added seprate forwardrequest code and added find things by clientReqId --- .../bbps/controller/AgentController.java | 18 ++ .../bbps/controller/PaymentController.java | 13 ++ .../bbps/dto/request/BaseClass.java | 14 -- .../request/BillFetchByClientIdRequest.java | 12 ++ .../bbps/dto/request/BillPaymentRequest.java | 1 + .../BillValidateByClientIdRequest.java | 12 ++ .../request/FetchBillValidatestRequest.java | 1 + .../TrasactionStatusByClientReqIdRequest.java | 11 ++ .../BillPaymentForwardRequest.java | 41 ++++ .../sentRequest/FetchBillForwardRequest.java | 24 +++ .../FetchBillValidatestForwardRequest.java | 24 +++ .../bbps/entites/BillerDetails.java | 8 +- .../repository/BillInitateRepository.java | 6 + .../bbps/repository/BillerDataRepository.java | 3 +- .../repository/PaymentIntiateRepository.java | 4 + .../bbps/service/AgentService.java | 14 +- .../bbps/service/PaymentService.java | 3 + .../bbps/serviceImpl/AgentServiceImpl.java | 179 ++++++++++++++++-- .../serviceImpl/MasterDataServiceImpl.java | 1 + .../bbps/serviceImpl/PaymentServiceImpl.java | 114 ++++++++++- .../bbps/util/BBPSConstant.java | 5 +- .../bbps/util/EntityRelationshipUtil.java | 22 +++ .../billpaymentservice/bbps/util/Helper.java | 76 +++++++- 23 files changed, 558 insertions(+), 48 deletions(-) create mode 100644 src/main/java/com/billpaymentservice/bbps/dto/request/BillFetchByClientIdRequest.java create mode 100644 src/main/java/com/billpaymentservice/bbps/dto/request/BillValidateByClientIdRequest.java create mode 100644 src/main/java/com/billpaymentservice/bbps/dto/request/TrasactionStatusByClientReqIdRequest.java create mode 100644 src/main/java/com/billpaymentservice/bbps/dto/sentRequest/BillPaymentForwardRequest.java create mode 100644 src/main/java/com/billpaymentservice/bbps/dto/sentRequest/FetchBillForwardRequest.java create mode 100644 src/main/java/com/billpaymentservice/bbps/dto/sentRequest/FetchBillValidatestForwardRequest.java diff --git a/src/main/java/com/billpaymentservice/bbps/controller/AgentController.java b/src/main/java/com/billpaymentservice/bbps/controller/AgentController.java index 100d063..1fed6a0 100644 --- a/src/main/java/com/billpaymentservice/bbps/controller/AgentController.java +++ b/src/main/java/com/billpaymentservice/bbps/controller/AgentController.java @@ -11,6 +11,8 @@ import org.springframework.web.bind.annotation.RestController; import com.billpaymentservice.bbps.dto.ResponseModel; import com.billpaymentservice.bbps.dto.request.BillFetchByBillIdRequest; +import com.billpaymentservice.bbps.dto.request.BillFetchByClientIdRequest; +import com.billpaymentservice.bbps.dto.request.BillValidateByClientIdRequest; import com.billpaymentservice.bbps.dto.request.FetchBillRequest; import com.billpaymentservice.bbps.dto.request.FetchBillValidatestRequest; import com.billpaymentservice.bbps.service.AgentService; @@ -68,5 +70,21 @@ public class AgentController { ResponseModel response = agentService.initiateBillValidateByBillId(billRequest); return ResponseEntity.ok(response); } + + @PostMapping(value = "/fetchBillByClientReqId", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity fetchBillByClientReqId( + @Validated @RequestBody BillFetchByClientIdRequest billFetchByClientIdRequest) { + + ResponseModel response = agentService.fetchBillByClientReqId(billFetchByClientIdRequest); + return ResponseEntity.ok(response); + } + + @PostMapping(value = "/fetchBillValidateByClientReqId", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity fetchBillValidateByClientReqId( + @Validated @RequestBody BillValidateByClientIdRequest billValidateByClientIdRequest) { + + ResponseModel response = agentService.fetchBillValidateByClientReqId(billValidateByClientIdRequest); + return ResponseEntity.ok(response); + } } diff --git a/src/main/java/com/billpaymentservice/bbps/controller/PaymentController.java b/src/main/java/com/billpaymentservice/bbps/controller/PaymentController.java index 2b091d2..3f3f5a8 100644 --- a/src/main/java/com/billpaymentservice/bbps/controller/PaymentController.java +++ b/src/main/java/com/billpaymentservice/bbps/controller/PaymentController.java @@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.RestController; import com.billpaymentservice.bbps.dto.ResponseModel; import com.billpaymentservice.bbps.dto.request.BillPaymentRequest; import com.billpaymentservice.bbps.dto.request.TransactionStatusRequest; +import com.billpaymentservice.bbps.dto.request.TrasactionStatusByClientReqIdRequest; import com.billpaymentservice.bbps.service.PaymentService; @RestController @@ -50,5 +51,17 @@ public class PaymentController { return ResponseEntity.ok(response); } + @PostMapping( + value = "/checkTransactionStatusByClientReqId", + consumes = MediaType.APPLICATION_JSON_VALUE, + produces = MediaType.APPLICATION_JSON_VALUE + ) + public ResponseEntity checkTransactionStatusByClientReqId( + @Validated @RequestBody TrasactionStatusByClientReqIdRequest transactionStatusRequest) { + + ResponseModel response = paymentService.checkTrasactionStatusByClientReqId(transactionStatusRequest); + return ResponseEntity.ok(response); + } + } diff --git a/src/main/java/com/billpaymentservice/bbps/dto/request/BaseClass.java b/src/main/java/com/billpaymentservice/bbps/dto/request/BaseClass.java index 78f7816..5c41339 100644 --- a/src/main/java/com/billpaymentservice/bbps/dto/request/BaseClass.java +++ b/src/main/java/com/billpaymentservice/bbps/dto/request/BaseClass.java @@ -20,49 +20,35 @@ import lombok.ToString; public abstract class BaseClass { - @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) @NotBlank(message = "MID cannot be null or blank") private String mid; - @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) @NotBlank(message = "Secret key cannot be null or blank") private String secretKey; - @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) @NotBlank(message = "Request ID cannot be null or blank") private String reqId; - @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) private DeviceDetail deviceDetial; // ✅ 10 User Defined Fields (UDF1–UDF10) - @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) private String udf1; - @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) private String udf2; - @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) private String udf3; - @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) private String udf4; - @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) private String udf5; - @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) private String udf6; - @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) private String udf7; - @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) private String udf8; - @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) private String udf9; - @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) private String udf10; } diff --git a/src/main/java/com/billpaymentservice/bbps/dto/request/BillFetchByClientIdRequest.java b/src/main/java/com/billpaymentservice/bbps/dto/request/BillFetchByClientIdRequest.java new file mode 100644 index 0000000..e473c03 --- /dev/null +++ b/src/main/java/com/billpaymentservice/bbps/dto/request/BillFetchByClientIdRequest.java @@ -0,0 +1,12 @@ +package com.billpaymentservice.bbps.dto.request; + +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class BillFetchByClientIdRequest extends BaseClass{ + + private String clientReqId; + +} diff --git a/src/main/java/com/billpaymentservice/bbps/dto/request/BillPaymentRequest.java b/src/main/java/com/billpaymentservice/bbps/dto/request/BillPaymentRequest.java index 2c395d2..90d441a 100644 --- a/src/main/java/com/billpaymentservice/bbps/dto/request/BillPaymentRequest.java +++ b/src/main/java/com/billpaymentservice/bbps/dto/request/BillPaymentRequest.java @@ -21,6 +21,7 @@ public class BillPaymentRequest extends BaseClass { private String customerMobNo; private Integer txnAmount; private String paymentRefId; + private String clientReqId; private String paymentChannel; private List deviceBlockTags; diff --git a/src/main/java/com/billpaymentservice/bbps/dto/request/BillValidateByClientIdRequest.java b/src/main/java/com/billpaymentservice/bbps/dto/request/BillValidateByClientIdRequest.java new file mode 100644 index 0000000..7b97bfd --- /dev/null +++ b/src/main/java/com/billpaymentservice/bbps/dto/request/BillValidateByClientIdRequest.java @@ -0,0 +1,12 @@ +package com.billpaymentservice.bbps.dto.request; + +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class BillValidateByClientIdRequest extends BaseClass{ + + private String clientReqId; + +} diff --git a/src/main/java/com/billpaymentservice/bbps/dto/request/FetchBillValidatestRequest.java b/src/main/java/com/billpaymentservice/bbps/dto/request/FetchBillValidatestRequest.java index 04bf04c..ab3c764 100644 --- a/src/main/java/com/billpaymentservice/bbps/dto/request/FetchBillValidatestRequest.java +++ b/src/main/java/com/billpaymentservice/bbps/dto/request/FetchBillValidatestRequest.java @@ -22,6 +22,7 @@ public class FetchBillValidatestRequest extends BaseClass { private String billerCategory; // String, CategoryResponseList of the biller @NotNull private String customerMobNo; // String, Mobile of the Customer + private String clientReqId; // Optional Fields private String macAddress; // Alphanumeric MAC Address of the Agent Server diff --git a/src/main/java/com/billpaymentservice/bbps/dto/request/TrasactionStatusByClientReqIdRequest.java b/src/main/java/com/billpaymentservice/bbps/dto/request/TrasactionStatusByClientReqIdRequest.java new file mode 100644 index 0000000..e4cca1d --- /dev/null +++ b/src/main/java/com/billpaymentservice/bbps/dto/request/TrasactionStatusByClientReqIdRequest.java @@ -0,0 +1,11 @@ +package com.billpaymentservice.bbps.dto.request; + +import lombok.Getter; +import lombok.Setter; +@Getter +@Setter +public class TrasactionStatusByClientReqIdRequest extends BaseClass{ + + private String clientReqId; + +} diff --git a/src/main/java/com/billpaymentservice/bbps/dto/sentRequest/BillPaymentForwardRequest.java b/src/main/java/com/billpaymentservice/bbps/dto/sentRequest/BillPaymentForwardRequest.java new file mode 100644 index 0000000..047432e --- /dev/null +++ b/src/main/java/com/billpaymentservice/bbps/dto/sentRequest/BillPaymentForwardRequest.java @@ -0,0 +1,41 @@ +package com.billpaymentservice.bbps.dto.sentRequest; + +import java.util.List; + +import com.billpaymentservice.bbps.dto.request.AmountBreakRequest; +import com.billpaymentservice.bbps.dto.request.CustomerParamTagRequest; +import com.billpaymentservice.bbps.dto.request.DeviceBlockTagRequest; +import com.billpaymentservice.bbps.dto.request.RemitterIdentityRequest; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class BillPaymentForwardRequest { + + private String tenantId; + private String refId; + private String billId; + private boolean amountOptions; + private String paymentMode; + private String paymentInformation; + private String billerId; + private String billerName; + private String billerCategory; + private String macAdress; + private String customerMobNo; + private Integer txnAmount; + private String paymentRefId; + private String clientReqId; + private String paymentChannel; + + private List deviceBlockTags; + private List customerParamsRequest; + private List remitterIdentity; + private List amountBreakSet; +} diff --git a/src/main/java/com/billpaymentservice/bbps/dto/sentRequest/FetchBillForwardRequest.java b/src/main/java/com/billpaymentservice/bbps/dto/sentRequest/FetchBillForwardRequest.java new file mode 100644 index 0000000..db5d184 --- /dev/null +++ b/src/main/java/com/billpaymentservice/bbps/dto/sentRequest/FetchBillForwardRequest.java @@ -0,0 +1,24 @@ +package com.billpaymentservice.bbps.dto.sentRequest; + +import java.util.List; +import com.billpaymentservice.bbps.dto.CustomerParamsRequest; +import com.billpaymentservice.bbps.dto.RemitterIdentity; +import com.billpaymentservice.bbps.dto.Tag; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class FetchBillForwardRequest { + private String billerId; + private String billerName; + private String billerCategory; + private String clientReqId; + private String macAdress; + private String customerMobNo; + private String remitterName; + private String paymentChannel; + private List deviceBlockTags; + private CustomerParamsRequest customerParamsRequest; + private List remitterIdentity; +} diff --git a/src/main/java/com/billpaymentservice/bbps/dto/sentRequest/FetchBillValidatestForwardRequest.java b/src/main/java/com/billpaymentservice/bbps/dto/sentRequest/FetchBillValidatestForwardRequest.java new file mode 100644 index 0000000..07e091f --- /dev/null +++ b/src/main/java/com/billpaymentservice/bbps/dto/sentRequest/FetchBillValidatestForwardRequest.java @@ -0,0 +1,24 @@ +package com.billpaymentservice.bbps.dto.sentRequest; + +import com.billpaymentservice.bbps.dto.CustomerParamsRequest; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class FetchBillValidatestForwardRequest { + + private String billerId; + private String billerName; + private String billerCategory; + private String customerMobNo; + private String clientReqId; + private String macAddress; + private CustomerParamsRequest customerParamsRequest; + +} diff --git a/src/main/java/com/billpaymentservice/bbps/entites/BillerDetails.java b/src/main/java/com/billpaymentservice/bbps/entites/BillerDetails.java index 55014dd..63b08fd 100644 --- a/src/main/java/com/billpaymentservice/bbps/entites/BillerDetails.java +++ b/src/main/java/com/billpaymentservice/bbps/entites/BillerDetails.java @@ -151,10 +151,12 @@ public class BillerDetails { @OneToMany(mappedBy = "biller", cascade = CascadeType.ALL, orphanRemoval = true) private List billerAdditionalInfos; + /* - * @OneToMany(mappedBy = "biller", cascade = CascadeType.ALL, orphanRemoval = - * true) private List billerAdditionalInfoPayments; - */ + * OneToMany(mappedBy = "biller", cascade = CascadeType.ALL, orphanRemoval + * =true) private List billerAdditionalInfoPayments; + */ + @OneToMany(mappedBy = "biller", cascade = CascadeType.ALL, orphanRemoval = true) private List interchangeFeeConves; diff --git a/src/main/java/com/billpaymentservice/bbps/repository/BillInitateRepository.java b/src/main/java/com/billpaymentservice/bbps/repository/BillInitateRepository.java index 3c7cd69..46012f7 100644 --- a/src/main/java/com/billpaymentservice/bbps/repository/BillInitateRepository.java +++ b/src/main/java/com/billpaymentservice/bbps/repository/BillInitateRepository.java @@ -1,5 +1,7 @@ package com.billpaymentservice.bbps.repository; +import java.util.Optional; + import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; @@ -8,4 +10,8 @@ import com.billpaymentservice.bbps.entites.BillInitiate; @Repository public interface BillInitateRepository extends JpaRepository { + Optional findByTxnId(String clientReqId); + + Optional findByReqId(String clientReqId); + } diff --git a/src/main/java/com/billpaymentservice/bbps/repository/BillerDataRepository.java b/src/main/java/com/billpaymentservice/bbps/repository/BillerDataRepository.java index ed6cca6..e7c0831 100644 --- a/src/main/java/com/billpaymentservice/bbps/repository/BillerDataRepository.java +++ b/src/main/java/com/billpaymentservice/bbps/repository/BillerDataRepository.java @@ -5,11 +5,10 @@ import java.util.Optional; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; - import com.billpaymentservice.bbps.entites.BillerDetails; @Repository public interface BillerDataRepository extends JpaRepository { - + Optional findByBillerId(String billerId); } diff --git a/src/main/java/com/billpaymentservice/bbps/repository/PaymentIntiateRepository.java b/src/main/java/com/billpaymentservice/bbps/repository/PaymentIntiateRepository.java index 187d29f..8b02f32 100644 --- a/src/main/java/com/billpaymentservice/bbps/repository/PaymentIntiateRepository.java +++ b/src/main/java/com/billpaymentservice/bbps/repository/PaymentIntiateRepository.java @@ -1,9 +1,13 @@ package com.billpaymentservice.bbps.repository; +import java.util.Optional; + import org.springframework.data.jpa.repository.JpaRepository; import com.billpaymentservice.bbps.entites.PaymentInitiate; public interface PaymentIntiateRepository extends JpaRepository { + Optional findByReqId(String clientReqId); + } diff --git a/src/main/java/com/billpaymentservice/bbps/service/AgentService.java b/src/main/java/com/billpaymentservice/bbps/service/AgentService.java index e529f4d..bdff362 100644 --- a/src/main/java/com/billpaymentservice/bbps/service/AgentService.java +++ b/src/main/java/com/billpaymentservice/bbps/service/AgentService.java @@ -2,17 +2,23 @@ package com.billpaymentservice.bbps.service; import com.billpaymentservice.bbps.dto.ResponseModel; import com.billpaymentservice.bbps.dto.request.BillFetchByBillIdRequest; +import com.billpaymentservice.bbps.dto.request.BillFetchByClientIdRequest; +import com.billpaymentservice.bbps.dto.request.BillValidateByClientIdRequest; import com.billpaymentservice.bbps.dto.request.FetchBillRequest; import com.billpaymentservice.bbps.dto.request.FetchBillValidatestRequest; public interface AgentService { - public ResponseModel initiateBillFetch(FetchBillRequest fetchBillRequest); + ResponseModel initiateBillFetch(FetchBillRequest fetchBillRequest); - public ResponseModel fetchBillById(BillFetchByBillIdRequest billFetchByBillIdRequest); + ResponseModel fetchBillById(BillFetchByBillIdRequest billFetchByBillIdRequest); - public ResponseModel initiateBillValidate(FetchBillValidatestRequest fetchBillValidateRequest); + ResponseModel initiateBillValidate(FetchBillValidatestRequest fetchBillValidateRequest); - public ResponseModel initiateBillValidateByBillId(BillFetchByBillIdRequest billRequest); + ResponseModel initiateBillValidateByBillId(BillFetchByBillIdRequest billRequest); + + ResponseModel fetchBillByClientReqId(BillFetchByClientIdRequest billFetchByClientIdRequest); + + ResponseModel fetchBillValidateByClientReqId( BillValidateByClientIdRequest billValidateByClientIdRequest); } diff --git a/src/main/java/com/billpaymentservice/bbps/service/PaymentService.java b/src/main/java/com/billpaymentservice/bbps/service/PaymentService.java index a25f681..dccb041 100644 --- a/src/main/java/com/billpaymentservice/bbps/service/PaymentService.java +++ b/src/main/java/com/billpaymentservice/bbps/service/PaymentService.java @@ -3,6 +3,7 @@ package com.billpaymentservice.bbps.service; import com.billpaymentservice.bbps.dto.ResponseModel; import com.billpaymentservice.bbps.dto.request.BillPaymentRequest; import com.billpaymentservice.bbps.dto.request.TransactionStatusRequest; +import com.billpaymentservice.bbps.dto.request.TrasactionStatusByClientReqIdRequest; public interface PaymentService { @@ -10,4 +11,6 @@ public interface PaymentService { public ResponseModel checkTrasactionStatus(TransactionStatusRequest transactionStatusRequest); + ResponseModel checkTrasactionStatusByClientReqId(TrasactionStatusByClientReqIdRequest transactionStatusRequest); + } diff --git a/src/main/java/com/billpaymentservice/bbps/serviceImpl/AgentServiceImpl.java b/src/main/java/com/billpaymentservice/bbps/serviceImpl/AgentServiceImpl.java index 5a25314..8686427 100644 --- a/src/main/java/com/billpaymentservice/bbps/serviceImpl/AgentServiceImpl.java +++ b/src/main/java/com/billpaymentservice/bbps/serviceImpl/AgentServiceImpl.java @@ -1,6 +1,7 @@ package com.billpaymentservice.bbps.serviceImpl; import java.util.Map; +import java.util.Optional; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -13,11 +14,15 @@ import org.springframework.web.client.RestClient; import com.billpaymentservice.bbps.dto.GeneralResp; import com.billpaymentservice.bbps.dto.ResponseModel; import com.billpaymentservice.bbps.dto.request.BillFetchByBillIdRequest; +import com.billpaymentservice.bbps.dto.request.BillFetchByClientIdRequest; +import com.billpaymentservice.bbps.dto.request.BillValidateByClientIdRequest; 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.FetchBillResponse; import com.billpaymentservice.bbps.dto.response.FetchBillValidateResponse; +import com.billpaymentservice.bbps.dto.sentRequest.FetchBillForwardRequest; +import com.billpaymentservice.bbps.dto.sentRequest.FetchBillValidatestForwardRequest; import com.billpaymentservice.bbps.entites.BharatConnectMaster; import com.billpaymentservice.bbps.entites.BillInitiate; import com.billpaymentservice.bbps.entites.BillMaster; @@ -37,7 +42,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; - import lombok.extern.slf4j.Slf4j; @Service @@ -77,7 +81,7 @@ public class AgentServiceImpl implements AgentService { String txnId = helper.generateTxnId(15); String requestId = fetchBillRequest.getReqId(); String fullUrl = agentDtaUrl + BBPSConstant.BILL_FETCH_INTI; - + fetchBillRequest.setClientReqId(txnId); helper.validateMerchant(fetchBillRequest.getMid()); BharatConnectMaster headersData = beneficiaryDetailsRepository.findByOrgId("ORG001"); @@ -89,18 +93,22 @@ public class AgentServiceImpl implements AgentService { ObjectMapper objectMapper = new ObjectMapper(); objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); - String requestJson = helper.convertObjectToJson(fetchBillRequest); + FetchBillForwardRequest forwardReq = + helper.fetchBillForwardRequestMap(fetchBillRequest); + String forwardJson = helper.convertObjectToJson(forwardReq); + String requestJson=helper.convertObjectToJson(fetchBillRequest); + // ✅ Create inbound & outbound logs InboundTraceLog inboundLog = helper.createInboundLog(requestId, txnId, apiName, fetchBillRequest.getMid(), "POST", requestJson); OutboundTraceLog outboundLog = helper.createOutboundLog(txnId, requestId, apiName, fullUrl, "POST", - requestJson); + forwardJson); LOGGER.debug("Outbound log created successfully for txnId: {} and reqId: {}", txnId, requestId); try { LOGGER.info("Calling external API: {}", fullUrl); - Map responseMap = httpService.postRequest(fullUrl, requestJson, headers); + Map responseMap = httpService.postRequest(fullUrl,forwardJson, headers); String responseData = responseMap.get("data"); helper.updateOutboundLogResponse(outboundLog, responseData); @@ -163,9 +171,7 @@ public class AgentServiceImpl implements AgentService { String reqId = billFetchByBillIdRequest.getReqId(); String billId = billFetchByBillIdRequest.getBillId(); String fullUrl = agentDtaUrl + BBPSConstant.BILL_FETCH_BY_ID + billFetchByBillIdRequest.getBillId(); - helper.validateMerchant(billFetchByBillIdRequest.getMid()); - BharatConnectMaster headersData = beneficiaryDetailsRepository.findByOrgId("ORG001"); HttpHeaders headers = new HttpHeaders(); headers.set("x-digiledge-key", headersData.getXDigiledgeKey()); @@ -204,7 +210,7 @@ public class AgentServiceImpl implements AgentService { LOGGER.info("Current Bill Status: {}", status); helper.updateInboundLogSuccess(inboundLog, responseData, generalResp.getStatus()); - helper.saveOrUpdateBillerData(responseWrapper, billFetchByBillIdRequest); + helper.saveOrUpdateBillData(responseWrapper, billFetchByBillIdRequest,txnId); LOGGER.info("Bill data saved successfully for billId: {}", billId); return new ResponseModel(generalResp.getMessage(), generalResp.getStatus(), @@ -222,7 +228,7 @@ public class AgentServiceImpl implements AgentService { String txnId = helper.generateTxnId(15); String reqId = billFetchByBillIdRequest.getReqId(); String billId = billFetchByBillIdRequest.getBillId(); - String fullUrl = agentDtaUrl + BBPSConstant.BILL_FETCH_BY_ID + "1ced7566-1add-4e01-9ed6-04cd67ac9684"; + String fullUrl = agentDtaUrl + BBPSConstant.BILL_FETCH_BY_ID + billFetchByBillIdRequest.getBillId(); LOGGER.info("Initiating {} API for billId={} and reqId={}", apiName, billId, reqId); @@ -260,7 +266,7 @@ public class AgentServiceImpl implements AgentService { ResponseModel responseModel = new ResponseModel(generalResp.getMessage(), generalResp.getStatus(), Integer.parseInt(generalResp.getStatusCode()), responseWrapper); - helper.saveOrUpdateBillerData(responseWrapper, billFetchByBillIdRequest); + helper.saveOrUpdateBillData(responseWrapper, billFetchByBillIdRequest,txnId); LOGGER.info("Bill data saved successfully for billId={} | Status={}", billId, generalResp.getStatus()); return responseModel; @@ -270,6 +276,10 @@ public class AgentServiceImpl implements AgentService { throw new CustomException("Invalid JSON received from API"); } } + + + + @Override public ResponseModel initiateBillValidate(FetchBillValidatestRequest fetchBillValidateRequest) { @@ -281,7 +291,7 @@ public class AgentServiceImpl implements AgentService { String txnId = helper.generateTxnId(15); String reqId = fetchBillValidateRequest.getReqId(); String fullUrl = agentDtaUrl + BBPSConstant.BILLER_VALIDATE_URL; - + fetchBillValidateRequest.setClientReqId(txnId); helper.validateMerchant(fetchBillValidateRequest.getMid()); BharatConnectMaster headersData = beneficiaryDetailsRepository.findByOrgId("ORG001"); @@ -293,18 +303,23 @@ public class AgentServiceImpl implements AgentService { ObjectMapper objectMapper = new ObjectMapper(); objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + FetchBillValidatestForwardRequest forwardReq = + helper.fetchBillValidatestForwardRequest(fetchBillValidateRequest); + + String forwardJson = helper.convertObjectToJson(forwardReq); + String requestJson = helper.convertObjectToJson(fetchBillValidateRequest); // ✅ Create inbound & outbound logs InboundTraceLog inboundLog = helper.createInboundLog(reqId, txnId, apiName, fetchBillValidateRequest.getMid(), "POST", requestJson); OutboundTraceLog outboundLog = helper.createOutboundLog(txnId, reqId, apiName, fullUrl, "POST", - requestJson); + forwardJson); LOGGER.debug("Outbound log created successfully for txnId: {} and reqId: {}", txnId, reqId); try { LOGGER.info("Calling external API: {}", fullUrl); - Map responseMap = httpService.postRequest(fullUrl, requestJson, headers); + Map responseMap = httpService.postRequest(fullUrl, forwardJson, headers); String responseData = responseMap.get("data"); helper.updateOutboundLogResponse(outboundLog, responseData); @@ -329,7 +344,6 @@ public class AgentServiceImpl implements AgentService { billMaster.setTxnId(txnId); billMasterRepository.save(billMaster); LOGGER.info("BillMaster saved for billId: {}", billMaster.getBillId()); - FetchBillResponse fetchBillResponse = objectMapper.convertValue(dataMap, FetchBillResponse.class); GeneralResp generalResponse = fetchBillResponse.getGenericResponse(); helper.updateInboundLogSuccess(inboundLog, responseData, generalResponse.getStatus()); @@ -431,7 +445,144 @@ public class AgentServiceImpl implements AgentService { } }} + + + //================================== Bill fetch and Bill Validate by Client Req Id==================================// + + @Override + public ResponseModel fetchBillValidateByClientReqId(BillValidateByClientIdRequest billValidateByClientIdRequest) { + String apiName = "FetchBillValidateByClientIdRequest"; + String txnId = helper.generateTxnId(15); + String reqId = billValidateByClientIdRequest.getReqId(); + String clientReqId = billValidateByClientIdRequest.getClientReqId(); + + Optional billInitiate = billIntiateRepository.findByReqId(clientReqId); + if (billInitiate.isEmpty()) { + throw new CustomException("No Bill Found for given Client Req Id"); + } + + String fullUrl = agentDtaUrl + BBPSConstant.BILL_VALIDATE_BY_CLIENT_REQ_ID + billInitiate.get().getTxnId(); + + helper.validateMerchant(billValidateByClientIdRequest.getMid()); + + BharatConnectMaster headersData = beneficiaryDetailsRepository.findByOrgId("ORG001"); + HttpHeaders headers = new HttpHeaders(); + headers.set("x-digiledge-key", headersData.getXDigiledgeKey()); + headers.set("agentId", headersData.getAgentId()); + headers.set("tenantId", headersData.getTenantId()); + headers.setContentType(MediaType.APPLICATION_JSON); + + ObjectMapper objectMapper = new ObjectMapper(); + + // 🔵 Create Inbound + Outbound Logs + InboundTraceLog inboundLog = helper.createInboundLog( + reqId, txnId, apiName, billValidateByClientIdRequest.getMid(), "GET", null); + + OutboundTraceLog outboundLog = helper.createOutboundLog( + txnId, reqId, apiName, fullUrl, "GET", null); + + try { + LOGGER.info("Calling BBPS API FetchBillValidateByClientReqId, URL={}", fullUrl); + Map responseMap = httpService.getRequest(fullUrl, headers); + String responseData = responseMap.get("data"); + + helper.updateOutboundLogResponse(outboundLog, responseData); + + Map dataMap = objectMapper.readValue(responseData, new TypeReference>() { + }); + + if (!dataMap.containsKey("genericResponse")) { + helper.updateInboundLogFailure(inboundLog, responseData, "INVALID_RESPONSE"); + throw new CustomException(String.valueOf(dataMap.get("message")), + String.valueOf(dataMap.get("status")), + Integer.parseInt(String.valueOf(dataMap.get("statusCode"))), + String.valueOf(dataMap.get("remarks"))); + } + + FetchBillValidateResponse responseWrapper = objectMapper.convertValue(dataMap, + FetchBillValidateResponse.class); + GeneralResp generalResp = responseWrapper.getGenericResponse(); + + helper.updateInboundLogSuccess(inboundLog, responseData, generalResp.getStatus()); + + return new ResponseModel(generalResp.getMessage(), generalResp.getStatus(), + Integer.parseInt(generalResp.getStatusCode()), responseWrapper); + + } catch (JsonProcessingException e) { + helper.updateInboundLogFailure(inboundLog, e.getMessage(), "JSON_ERROR"); + throw new CustomException("Invalid JSON received from API"); + } + } + + + + @Override + public ResponseModel fetchBillByClientReqId(BillFetchByClientIdRequest billFetchByClientIdRequest) { + + String apiName = "FetchBillByClientIdRequest"; + String txnId = helper.generateTxnId(15); + String reqId = billFetchByClientIdRequest.getReqId(); + String clientReqId = billFetchByClientIdRequest.getClientReqId(); + + Optional billInitiate = billIntiateRepository.findByReqId(clientReqId); + if (billInitiate.isEmpty()) { + throw new CustomException("No Bill Found for given Client Req Id"); + } + + String fullUrl = agentDtaUrl + BBPSConstant.BILL_VALIDATE_BY_CLIENT_REQ_ID + billInitiate.get().getTxnId(); + + helper.validateMerchant(billFetchByClientIdRequest.getMid()); + + BharatConnectMaster headersData = beneficiaryDetailsRepository.findByOrgId("ORG001"); + HttpHeaders headers = new HttpHeaders(); + headers.set("x-digiledge-key", headersData.getXDigiledgeKey()); + headers.set("agentId", headersData.getAgentId()); + headers.set("tenantId", headersData.getTenantId()); + headers.setContentType(MediaType.APPLICATION_JSON); + + ObjectMapper objectMapper = new ObjectMapper(); + + // 🔵 Create inbound + outbound logs + InboundTraceLog inboundLog = helper.createInboundLog( + reqId, txnId, apiName, billFetchByClientIdRequest.getMid(), "GET", null); + + OutboundTraceLog outboundLog = helper.createOutboundLog( + txnId, reqId, apiName, fullUrl, "GET", null); + + try { + LOGGER.info("Calling BBPS API FetchBillByClientReqId, URL={}", fullUrl); + Map responseMap = httpService.getRequest(fullUrl, headers); + String responseData = responseMap.get("data"); + + helper.updateOutboundLogResponse(outboundLog, responseData); + + Map dataMap = objectMapper.readValue(responseData, new TypeReference>() { + }); + + if (!dataMap.containsKey("genericResponse")) { + helper.updateInboundLogFailure(inboundLog, responseData, "INVALID_RESPONSE"); + throw new CustomException(String.valueOf(dataMap.get("message")), + String.valueOf(dataMap.get("status")), + Integer.parseInt(String.valueOf(dataMap.get("statusCode"))), + String.valueOf(dataMap.get("remarks"))); + } + + BillDataResponse responseWrapper = objectMapper.convertValue(dataMap, BillDataResponse.class); + GeneralResp generalResp = responseWrapper.getGenericResponse(); + + helper.updateInboundLogSuccess(inboundLog, responseData, generalResp.getStatus()); + + return new ResponseModel(generalResp.getMessage(), generalResp.getStatus(), + Integer.parseInt(generalResp.getStatusCode()), responseWrapper); + + } catch (JsonProcessingException e) { + helper.updateInboundLogFailure(inboundLog, e.getMessage(), "JSON_ERROR"); + throw new CustomException("Invalid JSON received from API"); + } + } + + /* diff --git a/src/main/java/com/billpaymentservice/bbps/serviceImpl/MasterDataServiceImpl.java b/src/main/java/com/billpaymentservice/bbps/serviceImpl/MasterDataServiceImpl.java index 04154b0..87da985 100644 --- a/src/main/java/com/billpaymentservice/bbps/serviceImpl/MasterDataServiceImpl.java +++ b/src/main/java/com/billpaymentservice/bbps/serviceImpl/MasterDataServiceImpl.java @@ -289,6 +289,7 @@ public class MasterDataServiceImpl implements MasterDataService { String fullUrl = String.format("%s%s?billerName=%s&category=%s&page=%d&pagesize=%d", masterRegisterUrl, BBPSConstant.BILLER_URL, masterRequest.getBillerName(), masterRequest.getCategory(), masterRequest.getPageNo(), masterRequest.getPageSize()); + LOGGER.info("Calling external API: {}", fullUrl); OutboundTraceLog outboundLog = helper.createOutboundLog(txnID, requestId, apiName, fullUrl, "GET", null); diff --git a/src/main/java/com/billpaymentservice/bbps/serviceImpl/PaymentServiceImpl.java b/src/main/java/com/billpaymentservice/bbps/serviceImpl/PaymentServiceImpl.java index 7275ad9..f0bbb9b 100644 --- a/src/main/java/com/billpaymentservice/bbps/serviceImpl/PaymentServiceImpl.java +++ b/src/main/java/com/billpaymentservice/bbps/serviceImpl/PaymentServiceImpl.java @@ -1,6 +1,7 @@ package com.billpaymentservice.bbps.serviceImpl; import java.util.Map; +import java.util.Optional; import org.modelmapper.ModelMapper; import org.modelmapper.convention.MatchingStrategies; @@ -14,8 +15,10 @@ import com.billpaymentservice.bbps.dto.GeneralResp; import com.billpaymentservice.bbps.dto.ResponseModel; import com.billpaymentservice.bbps.dto.request.BillPaymentRequest; import com.billpaymentservice.bbps.dto.request.TransactionStatusRequest; +import com.billpaymentservice.bbps.dto.request.TrasactionStatusByClientReqIdRequest; import com.billpaymentservice.bbps.dto.response.BillPaymentResponse; import com.billpaymentservice.bbps.dto.response.TransactionStatusResponse; +import com.billpaymentservice.bbps.dto.sentRequest.BillPaymentForwardRequest; import com.billpaymentservice.bbps.entites.AgentFundTransfer; import com.billpaymentservice.bbps.entites.BharatConnectMaster; import com.billpaymentservice.bbps.entites.BillPayment; @@ -80,7 +83,7 @@ public class PaymentServiceImpl implements PaymentService { String txnId = helper.generateTxnId(15); String requestId = billPaymentRequest.getReqId(); String url = paymentUrl + BBPSConstant.PAYMENT_URL; - + billPaymentRequest.setClientReqId(txnId); LOGGER.info("Initiating payment for reqId={} and txnId={}", requestId, txnId); BharatConnectMaster headersData = beneficiaryDetailsRepository.findByOrgId("ORG001"); @@ -92,15 +95,20 @@ public class PaymentServiceImpl implements PaymentService { ObjectMapper objectMapper = new ObjectMapper(); objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + BillPaymentForwardRequest forwardReq = + helper.billPaymentForwardRequest(billPaymentRequest); + + String forwardjson = helper.convertObjectToJson(forwardReq); + String requestJson = helper.convertObjectToJson(billPaymentRequest); InboundTraceLog inboundLog = helper.createInboundLog(requestId, txnId, apiName, billPaymentRequest.getMid(), "POST", requestJson); - OutboundTraceLog outboundLog = helper.createOutboundLog(txnId, requestId, apiName, url, "POST", requestJson); + OutboundTraceLog outboundLog = helper.createOutboundLog(txnId, requestId, apiName, url, "POST",forwardjson); try { LOGGER.info("Calling BBPS payment URL: {}", url); - Map responseMap = httpService.postRequest(url, requestJson, headers); + Map responseMap = httpService.postRequest(url, forwardjson, headers); String responseData = responseMap.get("data"); LOGGER.info("Payment API Response: {}", responseData); @@ -142,7 +150,7 @@ public class PaymentServiceImpl implements PaymentService { transactionStatusRequest.setReqId(requestId); try { - Thread.sleep(2000); + Thread.sleep(9000); } catch (InterruptedException e) { Thread.currentThread().interrupt(); LOGGER.warn("Thread interrupted during payment delay: {}", e.getMessage()); @@ -161,6 +169,8 @@ public class PaymentServiceImpl implements PaymentService { String apiName = "CheckTransactionStatus"; String txnId = helper.generateTxnId(15); String requestId = transactionStatusRequest.getReqId(); + + String url = paymentUrl + BBPSConstant.CHECK_TRANSACTION_URL + transactionStatusRequest.getTxnId(); LOGGER.info("Checking transaction status (internal) for txnId={} and reqId={}", transactionStatusRequest.getTxnId(), requestId); @@ -293,8 +303,102 @@ public class PaymentServiceImpl implements PaymentService { throw new CustomException("Invalid JSON received from API"); } } -} + + + @Override + public ResponseModel checkTrasactionStatusByClientReqId(TrasactionStatusByClientReqIdRequest transactionStatusRequest) { + + helper.validateMerchant(transactionStatusRequest.getMid()); + + String txnID = helper.generateTxnId(15); + String apiName = "checkTrasactionStatusbyClientReqId"; + String requestId = transactionStatusRequest.getReqId(); + String clientReqId = transactionStatusRequest.getClientReqId(); + String requestJson = helper.convertObjectToJson(transactionStatusRequest); + + LOGGER.info("Checking transaction status for clientReqId={} and reqId={}", clientReqId, requestId); + + // Fetch Txn from DB + Optional paymentInitiate = paymentIntiateRepository.findByReqId(clientReqId); + if (paymentInitiate.isEmpty()) { + throw new CustomException("No Transaction Found for given Client Req Id"); + } + + String url = paymentUrl + BBPSConstant.CHECK_TRANSACTION_BY_CLIENT_REQ_ID_URL + paymentInitiate.get().getTxnId(); + + // Prepare headers + BharatConnectMaster headersData = beneficiaryDetailsRepository.findByOrgId("ORG001"); + HttpHeaders headers = new HttpHeaders(); + headers.set("x-digiledge-key", headersData.getXDigiledgeKey()); + headers.set("agentId", headersData.getAgentId()); + headers.set("tenantId", headersData.getTenantId()); + headers.setContentType(MediaType.APPLICATION_JSON); + + + // 🔵 Create Inbound + Outbound Logs + InboundTraceLog inboundLog = helper.createInboundLog( + requestId, txnID, apiName, transactionStatusRequest.getMid(), "POST", requestJson); + + OutboundTraceLog outboundLog = helper.createOutboundLog( + txnID, requestId, apiName, url, "GET", null); + + ObjectMapper objectMapper = new ObjectMapper(); + + try { + LOGGER.info("Calling BBPS Transaction Status API URL={}", url); + Map responseMap = httpService.getRequest(url, headers); + + String responseData = responseMap.get("data"); + LOGGER.info("Transaction Status Response: {}", responseData); + + helper.updateOutboundLogResponse(outboundLog, responseData); + + // Parse response + Map dataMap = objectMapper.readValue( + responseData, new TypeReference>() {}); + + // Validate response + if (!dataMap.containsKey("generalResp")) { + helper.updateInboundLogFailure(inboundLog, responseData, "INVALID_RESPONSE"); + + LOGGER.warn("Invalid transaction status response for clientReqId={} | Response={}", + clientReqId, responseData); + + throw new CustomException( + String.valueOf(dataMap.get("message")), + String.valueOf(dataMap.get("status")), + Integer.parseInt(String.valueOf(dataMap.get("statusCode"))), + String.valueOf(dataMap.get("remarks")) + ); + } + + // Convert into proper DTO + TransactionStatusResponse responseWrapper = + objectMapper.convertValue(dataMap, TransactionStatusResponse.class); + + GeneralResp generalResp = responseWrapper.getGeneralResp(); + + LOGGER.info("Transaction Status for clientReqId={} => {}", clientReqId, generalResp.getStatus()); + + helper.updateInboundLogSuccess(inboundLog, responseData, generalResp.getStatus()); + + return new ResponseModel( + generalResp.getMessage(), + generalResp.getStatus(), + Integer.parseInt(generalResp.getStatusCode()), + responseWrapper + ); + + } catch (JsonProcessingException e) { + LOGGER.error("Error parsing JSON in transaction status API: {}", e.getMessage(), e); + + helper.updateInboundLogFailure(inboundLog, e.getMessage(), "JSON_ERROR"); + + throw new CustomException("Invalid JSON received from API"); + } + } +} /* PollBack logic for the fetchTxnByTxnId API * @Override public ResponseModel fetchTxnByTxnId(BillFetchByBillIdRequest * billFetchByBillIdRequest) { diff --git a/src/main/java/com/billpaymentservice/bbps/util/BBPSConstant.java b/src/main/java/com/billpaymentservice/bbps/util/BBPSConstant.java index 98744dd..77c70c6 100644 --- a/src/main/java/com/billpaymentservice/bbps/util/BBPSConstant.java +++ b/src/main/java/com/billpaymentservice/bbps/util/BBPSConstant.java @@ -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"; - } diff --git a/src/main/java/com/billpaymentservice/bbps/util/EntityRelationshipUtil.java b/src/main/java/com/billpaymentservice/bbps/util/EntityRelationshipUtil.java index 45967c4..945d6fe 100644 --- a/src/main/java/com/billpaymentservice/bbps/util/EntityRelationshipUtil.java +++ b/src/main/java/com/billpaymentservice/bbps/util/EntityRelationshipUtil.java @@ -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; + } } diff --git a/src/main/java/com/billpaymentservice/bbps/util/Helper.java b/src/main/java/com/billpaymentservice/bbps/util/Helper.java index e9b9291..379ba40 100644 --- a/src/main/java/com/billpaymentservice/bbps/util/Helper.java +++ b/src/main/java/com/billpaymentservice/bbps/util/Helper.java @@ -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; + } } \ No newline at end of file From 5d57f92dad982429afdc6a3fad5823918f9fbd87 Mon Sep 17 00:00:00 2001 From: Lincpay Tech Date: Fri, 21 Nov 2025 10:05:22 +0530 Subject: [PATCH 3/3] cleaned entity entity relationshopUtil --- .../repository/PaymentIntiateRepository.java | 2 +- .../bbps/service/AgentService.java | 2 +- .../bbps/util/EntityRelationshipUtil.java | 19 +------------------ 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/billpaymentservice/bbps/repository/PaymentIntiateRepository.java b/src/main/java/com/billpaymentservice/bbps/repository/PaymentIntiateRepository.java index 8b02f32..cb54f23 100644 --- a/src/main/java/com/billpaymentservice/bbps/repository/PaymentIntiateRepository.java +++ b/src/main/java/com/billpaymentservice/bbps/repository/PaymentIntiateRepository.java @@ -8,6 +8,6 @@ import com.billpaymentservice.bbps.entites.PaymentInitiate; public interface PaymentIntiateRepository extends JpaRepository { - Optional findByReqId(String clientReqId); + Optional findByReqId(String clientReqId); } diff --git a/src/main/java/com/billpaymentservice/bbps/service/AgentService.java b/src/main/java/com/billpaymentservice/bbps/service/AgentService.java index bdff362..3c5347b 100644 --- a/src/main/java/com/billpaymentservice/bbps/service/AgentService.java +++ b/src/main/java/com/billpaymentservice/bbps/service/AgentService.java @@ -8,7 +8,7 @@ import com.billpaymentservice.bbps.dto.request.FetchBillRequest; import com.billpaymentservice.bbps.dto.request.FetchBillValidatestRequest; public interface AgentService { - + ResponseModel initiateBillFetch(FetchBillRequest fetchBillRequest); ResponseModel fetchBillById(BillFetchByBillIdRequest billFetchByBillIdRequest); diff --git a/src/main/java/com/billpaymentservice/bbps/util/EntityRelationshipUtil.java b/src/main/java/com/billpaymentservice/bbps/util/EntityRelationshipUtil.java index 945d6fe..b7b24c3 100644 --- a/src/main/java/com/billpaymentservice/bbps/util/EntityRelationshipUtil.java +++ b/src/main/java/com/billpaymentservice/bbps/util/EntityRelationshipUtil.java @@ -92,24 +92,7 @@ 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; - } + }