removed heades section from impl and added it in helper
This commit is contained in:
@@ -11,6 +11,8 @@ import java.util.stream.Collectors;
|
||||
import org.modelmapper.ModelMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.billpaymentservice.bbps.dto.AdditionalInfoBillDTO;
|
||||
@@ -38,6 +40,7 @@ import com.billpaymentservice.bbps.entites.InboundTraceLog;
|
||||
import com.billpaymentservice.bbps.entites.OutboundTraceLog;
|
||||
import com.billpaymentservice.bbps.entites.PaymentChannel;
|
||||
import com.billpaymentservice.bbps.entites.PaymentMode;
|
||||
import com.billpaymentservice.bbps.entites.BharatConnectMaster;
|
||||
import com.billpaymentservice.bbps.exception.CustomException;
|
||||
import com.billpaymentservice.bbps.repository.BBPSMasterDataRepo;
|
||||
import com.billpaymentservice.bbps.repository.BillMasterRepository;
|
||||
@@ -214,6 +217,19 @@ public class Helper {
|
||||
|
||||
}
|
||||
/* ---------- End helpers ---------- */
|
||||
|
||||
// New reusable header builder for BBPS calls
|
||||
public HttpHeaders buildHeaders(BharatConnectMaster headersData) {
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
if (headersData != null) {
|
||||
headers.set("x-digiledge-key", headersData.getXDigiledgeKey());
|
||||
headers.set("agentId", headersData.getAgentId());
|
||||
headers.set("tenantId", headersData.getTenantId());
|
||||
}
|
||||
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||
return headers;
|
||||
}
|
||||
|
||||
public void saveOrUpdateBillerData(BillerDetails newEntity) {
|
||||
|
||||
Optional<BillerDetails> existingOpt = billerDataRespository.findByBillerId(newEntity.getBillerId());
|
||||
@@ -233,7 +249,7 @@ public void saveOrUpdateBillData(BillDataResponse responseWrapper,
|
||||
|
||||
BillMaster billMaster = new BillMaster();
|
||||
|
||||
billMaster.setBillId(billFetchByBillIdRequest.getBillId());
|
||||
billMaster.setBillId(responseWrapper.getBillId());
|
||||
billMaster.setRefId(responseWrapper.getRefId());
|
||||
billMaster.setBillerId(responseWrapper.getBillerId());
|
||||
billMaster.setStatus(responseWrapper.getStatus());
|
||||
@@ -242,7 +258,6 @@ billMaster.setUserId(responseWrapper.getUserId());
|
||||
billMaster.setReqId(billFetchByBillIdRequest.getReqId());
|
||||
billMaster.setTxnId(txnId);
|
||||
|
||||
|
||||
// BILLER RESPONSE
|
||||
BillerResponse billerResponse = new BillerResponse();
|
||||
if (responseWrapper.getBillerResponse() != null) {
|
||||
|
||||
Reference in New Issue
Block a user