merging code arham1
This commit is contained in:
@@ -2,55 +2,38 @@
|
|||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
<version>3.2.5</version>
|
<version>3.2.7</version> <!-- ✅ LTS and stable -->
|
||||||
<relativePath /> <!-- lookup parent from repository -->
|
<relativePath />
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<groupId>com.billpaymentservice.bbps</groupId>
|
<groupId>com.billpaymentservice.bbps</groupId>
|
||||||
<artifactId>bbps</artifactId>
|
<artifactId>bbps</artifactId>
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
<name>bbps</name>
|
<name>bbps</name>
|
||||||
<description>This is the bbps switch project</description>
|
<description>This is the bbps switch project</description>
|
||||||
<url />
|
|
||||||
<licenses>
|
|
||||||
<license />
|
|
||||||
</licenses>
|
|
||||||
<developers>
|
|
||||||
<developer />
|
|
||||||
</developers>
|
|
||||||
<scm>
|
|
||||||
<connection />
|
|
||||||
<developerConnection />
|
|
||||||
<tag />
|
|
||||||
<url />
|
|
||||||
</scm>
|
|
||||||
<properties>
|
<properties>
|
||||||
<java.version>17</java.version>
|
<java.version>17</java.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<!-- Core Spring Boot Starters -->
|
||||||
<groupId>io.github.resilience4j</groupId>
|
|
||||||
<artifactId>resilience4j-spring-boot3</artifactId>
|
|
||||||
<version>2.2.0</version> <!-- Latest stable version -->
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-aop</artifactId>
|
<artifactId>spring-boot-starter</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<!-- ❌ Exclude old HttpClient 4.x -->
|
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>org.apache.httpcomponents</groupId>
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
<artifactId>httpclient</artifactId>
|
<artifactId>httpclient</artifactId>
|
||||||
@@ -58,59 +41,51 @@
|
|||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
|
||||||
<artifactId>jackson-dataformat-xml</artifactId>
|
|
||||||
<version>2.13.3</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-devtools</artifactId>
|
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||||
<scope>runtime</scope>
|
|
||||||
<optional>true</optional>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.postgresql</groupId>
|
|
||||||
<artifactId>postgresql</artifactId>
|
|
||||||
<scope>runtime</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.projectlombok</groupId>
|
|
||||||
<artifactId>lombok</artifactId>
|
|
||||||
<version>1.18.30</version> <!-- Use latest stable -->
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.nimbusds</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>nimbus-jose-jwt</artifactId>
|
<artifactId>spring-boot-starter-aop</artifactId>
|
||||||
<version>9.37</version> <!-- Use latest stable version -->
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Tomcat (provided for WAR) -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.modelmapper</groupId>
|
|
||||||
<artifactId>modelmapper</artifactId>
|
|
||||||
<version>3.2.0</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
|
<!-- Database Driver -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.postgresql</groupId>
|
||||||
<artifactId>spring-boot-starter-test</artifactId>
|
<artifactId>postgresql</artifactId>
|
||||||
<scope>test</scope>
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Resilience4j -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springdoc</groupId>
|
<groupId>io.github.resilience4j</groupId>
|
||||||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
<artifactId>resilience4j-spring-boot3</artifactId>
|
||||||
<version>2.5.0</version>
|
<version>2.2.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- JSON + XML -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
||||||
|
<artifactId>jackson-dataformat-xml</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- JWT -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.nimbusds</groupId>
|
||||||
|
<artifactId>nimbus-jose-jwt</artifactId>
|
||||||
|
<version>9.37</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- HttpClient 5 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.httpcomponents.client5</groupId>
|
<groupId>org.apache.httpcomponents.client5</groupId>
|
||||||
<artifactId>httpclient5</artifactId>
|
<artifactId>httpclient5</artifactId>
|
||||||
@@ -121,32 +96,56 @@
|
|||||||
<artifactId>httpcore5</artifactId>
|
<artifactId>httpcore5</artifactId>
|
||||||
<version>5.2.5</version>
|
<version>5.2.5</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.httpcomponents.core5</groupId>
|
<groupId>org.apache.httpcomponents.core5</groupId>
|
||||||
<artifactId>httpcore5-h2</artifactId>
|
<artifactId>httpcore5-h2</artifactId>
|
||||||
<version>5.2.5</version>
|
<version>5.2.5</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- ModelMapper -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.modelmapper</groupId>
|
||||||
|
<artifactId>modelmapper</artifactId>
|
||||||
|
<version>3.2.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- (Optional) ✅ Fluent API for HttpClient5 (useful if you ever need
|
<!-- Lombok -->
|
||||||
direct HttpClient) -->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.httpcomponents.client5</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>httpclient5-fluent</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
<version>5.3.1</version>
|
<version>1.18.30</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- DevTools -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-devtools</artifactId>
|
||||||
<scope>runtime</scope>
|
<scope>runtime</scope>
|
||||||
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Swagger / OpenAPI -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springdoc</groupId>
|
||||||
|
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||||||
|
<version>2.5.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Test -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Configuration Processor -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
|
||||||
<optional>true</optional>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
@@ -159,7 +158,7 @@
|
|||||||
<path>
|
<path>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
<version>1.18.42</version> <!-- ✅ Required -->
|
<version>1.18.30</version>
|
||||||
</path>
|
</path>
|
||||||
</annotationProcessorPaths>
|
</annotationProcessorPaths>
|
||||||
</configuration>
|
</configuration>
|
||||||
@@ -168,14 +167,6 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
<configuration>
|
|
||||||
<excludes>
|
|
||||||
<exclude>
|
|
||||||
<groupId>org.projectlombok</groupId>
|
|
||||||
<artifactId>lombok</artifactId>
|
|
||||||
</exclude>
|
|
||||||
</excludes>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ public class AgentServiceImpl implements AgentService {
|
|||||||
headers.set("agentId", headersData.getAgentId());
|
headers.set("agentId", headersData.getAgentId());
|
||||||
headers.set("tenantId", headersData.getTenantId());
|
headers.set("tenantId", headersData.getTenantId());
|
||||||
headers.setContentType(MediaType.APPLICATION_JSON);
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||||
|
|
||||||
ResponseModel responseModel = new ResponseModel();
|
ResponseModel responseModel = new ResponseModel();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ import com.billpaymentservice.bbps.repository.DispositionRepository;
|
|||||||
import com.billpaymentservice.bbps.repository.MerchantRepository;
|
import com.billpaymentservice.bbps.repository.MerchantRepository;
|
||||||
import com.billpaymentservice.bbps.service.MasterDataService;
|
import com.billpaymentservice.bbps.service.MasterDataService;
|
||||||
import com.billpaymentservice.bbps.util.BBPSConstant;
|
import com.billpaymentservice.bbps.util.BBPSConstant;
|
||||||
|
import com.billpaymentservice.bbps.util.EntityRelationshipUtil;
|
||||||
import com.billpaymentservice.bbps.util.Helper;
|
import com.billpaymentservice.bbps.util.Helper;
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import com.fasterxml.jackson.core.type.TypeReference;
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
@@ -62,10 +63,8 @@ public class MasterDataServiceImpl implements MasterDataService {
|
|||||||
private MerchantRepository merchantRegisterRepo;
|
private MerchantRepository merchantRegisterRepo;
|
||||||
private HttpClientApi httpClientApi;
|
private HttpClientApi httpClientApi;
|
||||||
private final DispositionRepository dispositionRepository;
|
private final DispositionRepository dispositionRepository;
|
||||||
private Helper helper;
|
private final Helper helper;
|
||||||
private final BillerDataRepository billerDataRespository;
|
private final BillerDataRepository billerDataRespository;
|
||||||
|
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(MasterDataServiceImpl.class);
|
private static final Logger log = LoggerFactory.getLogger(MasterDataServiceImpl.class);
|
||||||
private final HttpService httpService;
|
private final HttpService httpService;
|
||||||
private final ObjectMapper objectMapper = new ObjectMapper();
|
private final ObjectMapper objectMapper = new ObjectMapper();
|
||||||
@@ -109,69 +108,19 @@ public class MasterDataServiceImpl implements MasterDataService {
|
|||||||
Integer.parseInt(String.valueOf(dataMap.get("statusCode"))), // statusCode (int)
|
Integer.parseInt(String.valueOf(dataMap.get("statusCode"))), // statusCode (int)
|
||||||
String.valueOf(dataMap.get("remarks")) );
|
String.valueOf(dataMap.get("remarks")) );
|
||||||
}
|
}
|
||||||
|
|
||||||
BillerDataResponse responseWrapper = objectMapper.convertValue(dataMap, BillerDataResponse.class);
|
BillerDataResponse responseWrapper = objectMapper.convertValue(dataMap, BillerDataResponse.class);
|
||||||
GeneralResp generalResp = responseWrapper.getGeneralResp();
|
GeneralResp generalResp = responseWrapper.getGeneralResp();
|
||||||
ModelMapper mapper = new ModelMapper();
|
ModelMapper mapper = new ModelMapper();
|
||||||
mapper.getConfiguration().setMatchingStrategy(MatchingStrategies.STRICT);
|
mapper.getConfiguration().setMatchingStrategy(MatchingStrategies.STRICT);
|
||||||
BillerDetails entity = mapper.map(responseWrapper.getBillerDAO(), BillerDetails.class);
|
BillerDetails entity = mapper.map(responseWrapper.getBillerDAO(), BillerDetails.class);
|
||||||
|
EntityRelationshipUtil.linkBillerRelationships(entity);
|
||||||
// Manually set parent reference
|
// billerDataRespository.save(entity);
|
||||||
if (entity.getBillerPaymentModes() != null) {
|
|
||||||
entity.getBillerPaymentModes().forEach(m -> m.setBiller(entity));
|
|
||||||
}
|
|
||||||
if (entity.getBillerPaymentChannels() != null) {
|
|
||||||
entity.getBillerPaymentChannels().forEach(c -> c.setBiller(entity));
|
|
||||||
}
|
|
||||||
if (entity.getBillerCustomerParams() != null) {
|
|
||||||
entity.getBillerCustomerParams().forEach(p -> p.setBiller(entity));
|
|
||||||
}
|
|
||||||
if (entity.getBillerAdditionalInfos() != null) {
|
|
||||||
entity.getBillerAdditionalInfos().forEach(a -> a.setBiller(entity));
|
|
||||||
}
|
|
||||||
if (entity.getInterchangeFees() != null) {
|
|
||||||
for (InterchangeFee fee : entity.getInterchangeFees()) {
|
|
||||||
fee.setBiller(entity); // link InterchangeFee → BillerDetails
|
|
||||||
|
|
||||||
if (fee.getInterchangeFeeDetails() != null) {
|
|
||||||
for (InterchangeFeeDetail detail : fee.getInterchangeFeeDetails()) {
|
|
||||||
detail.setInterchangeFee(fee); // link InterchangeFeeDetail → InterchangeFee
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (entity.getInterchangeFeeConves() != null) {
|
|
||||||
entity.getInterchangeFeeConves().forEach(fc -> fc.setBiller(entity));
|
|
||||||
}
|
|
||||||
|
|
||||||
// For OneToOne relationships
|
|
||||||
if (entity.getCustomerParamGroups() != null)
|
|
||||||
entity.getCustomerParamGroups().setBiller(entity);
|
|
||||||
|
|
||||||
if (entity.getBillerPlanResponseParams() != null)
|
|
||||||
entity.getBillerPlanResponseParams().setBiller(entity);
|
|
||||||
|
|
||||||
// 🔥🔥🔥 YEH MISSING CODE ADD KARO 🔥🔥🔥
|
|
||||||
if (entity.getBillerResponseParams() != null) {
|
|
||||||
BillerResponseParams responseParams = entity.getBillerResponseParams();
|
|
||||||
responseParams.setBiller(entity); // Parent reference
|
|
||||||
|
|
||||||
// 🔥 AMOUNT OPTIONS KE RELATIONSHIPS SET KARO
|
|
||||||
if (responseParams.getAmountOptions() != null) {
|
|
||||||
for (AmountOption option : responseParams.getAmountOptions()) {
|
|
||||||
option.setBillerResponseParams(responseParams); // YEH MISSING THA
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
billerDataRespository.save(entity);
|
|
||||||
ResponseModel responseModel = new ResponseModel(
|
ResponseModel responseModel = new ResponseModel(
|
||||||
generalResp.getMessage(),
|
generalResp.getMessage(),
|
||||||
generalResp.getStatus(),
|
generalResp.getStatus(),
|
||||||
Integer.parseInt(generalResp.getStatusCode()),
|
Integer.parseInt(generalResp.getStatusCode()),
|
||||||
responseWrapper
|
responseWrapper
|
||||||
);
|
);
|
||||||
|
|
||||||
return responseModel;
|
return responseModel;
|
||||||
|
|
||||||
} catch (JsonProcessingException e) {
|
} catch (JsonProcessingException e) {
|
||||||
@@ -216,7 +165,6 @@ public class MasterDataServiceImpl implements MasterDataService {
|
|||||||
Integer.parseInt(generalResp.getStatusCode()),
|
Integer.parseInt(generalResp.getStatusCode()),
|
||||||
responseWrapper
|
responseWrapper
|
||||||
);
|
);
|
||||||
|
|
||||||
return responseModel;
|
return responseModel;
|
||||||
|
|
||||||
} catch (JsonProcessingException e) {
|
} catch (JsonProcessingException e) {
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public class PaymentServiceImpl implements PaymentService {
|
|||||||
public ResponseModel initiatePayment(BillPaymentRequest billPaymentRequest) {
|
public ResponseModel initiatePayment(BillPaymentRequest billPaymentRequest) {
|
||||||
|
|
||||||
String url = paymentUrl + BBPSConstant.PAYMENT_URL;
|
String url = paymentUrl + BBPSConstant.PAYMENT_URL;
|
||||||
System.out.println(url);
|
System.out.println(url);
|
||||||
|
|
||||||
BharatConnectMaster headersData = beneficiaryDetailsRepository.findByOrgId("ORG001");
|
BharatConnectMaster headersData = beneficiaryDetailsRepository.findByOrgId("ORG001");
|
||||||
|
|
||||||
@@ -102,6 +102,7 @@ public class PaymentServiceImpl implements PaymentService {
|
|||||||
BillPaymentResponse billPaymentResponse = objectMapper.convertValue(dataMap, BillPaymentResponse.class);
|
BillPaymentResponse billPaymentResponse = objectMapper.convertValue(dataMap, BillPaymentResponse.class);
|
||||||
System.out.print(billPaymentResponse);
|
System.out.print(billPaymentResponse);
|
||||||
GeneralResp generalResponse = billPaymentResponse.getGenericResponse();
|
GeneralResp generalResponse = billPaymentResponse.getGenericResponse();
|
||||||
|
|
||||||
//
|
//
|
||||||
// start a new thread here
|
// start a new thread here
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package com.billpaymentservice.bbps.util;
|
||||||
|
|
||||||
|
import com.billpaymentservice.bbps.entites.*;
|
||||||
|
|
||||||
|
public class EntityRelationshipUtil {
|
||||||
|
|
||||||
|
private EntityRelationshipUtil() {
|
||||||
|
// prevent instantiation
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Links all parent-child relationships for BillerDetails and nested entities.
|
||||||
|
* Ensures bidirectional JPA relationships are correctly set before saving.
|
||||||
|
*/
|
||||||
|
public static void linkBillerRelationships(BillerDetails entity) {
|
||||||
|
|
||||||
|
if (entity == null) return;
|
||||||
|
|
||||||
|
if (entity.getBillerPaymentModes() != null) {
|
||||||
|
entity.getBillerPaymentModes().forEach(m -> m.setBiller(entity));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (entity.getBillerPaymentChannels() != null) {
|
||||||
|
entity.getBillerPaymentChannels().forEach(c -> c.setBiller(entity));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (entity.getBillerCustomerParams() != null) {
|
||||||
|
entity.getBillerCustomerParams().forEach(p -> p.setBiller(entity));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (entity.getBillerAdditionalInfos() != null) {
|
||||||
|
entity.getBillerAdditionalInfos().forEach(a -> a.setBiller(entity));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (entity.getInterchangeFees() != null) {
|
||||||
|
for (InterchangeFee fee : entity.getInterchangeFees()) {
|
||||||
|
fee.setBiller(entity);
|
||||||
|
|
||||||
|
if (fee.getInterchangeFeeDetails() != null) {
|
||||||
|
fee.getInterchangeFeeDetails().forEach(detail -> detail.setInterchangeFee(fee));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (entity.getInterchangeFeeConves() != null) {
|
||||||
|
entity.getInterchangeFeeConves().forEach(fc -> fc.setBiller(entity));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (entity.getCustomerParamGroups() != null)
|
||||||
|
entity.getCustomerParamGroups().setBiller(entity);
|
||||||
|
|
||||||
|
if (entity.getBillerPlanResponseParams() != null)
|
||||||
|
entity.getBillerPlanResponseParams().setBiller(entity);
|
||||||
|
|
||||||
|
if (entity.getBillerResponseParams() != null) {
|
||||||
|
BillerResponseParams responseParams = entity.getBillerResponseParams();
|
||||||
|
responseParams.setBiller(entity);
|
||||||
|
|
||||||
|
if (responseParams.getAmountOptions() != null) {
|
||||||
|
responseParams.getAmountOptions()
|
||||||
|
.forEach(option -> option.setBillerResponseParams(responseParams));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
+4
-5
@@ -1,4 +1,4 @@
|
|||||||
package com.lincpay.bbps;
|
package com.billpaymentservice.bbps;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
@@ -6,8 +6,7 @@ import org.springframework.boot.test.context.SpringBootTest;
|
|||||||
@SpringBootTest
|
@SpringBootTest
|
||||||
class BbpsApplicationTests {
|
class BbpsApplicationTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void contextLoads() {
|
void contextLoads() {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
package com.billpaymentservice.bbps.controller;
|
|
||||||
|
|
||||||
import com.billpaymentservice.bbps.serviceImpl.HttpService;
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
|
||||||
|
|
||||||
@SpringBootTest
|
|
||||||
public class TestHttpControllerTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private HttpService httpService;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void testGetRequest() {
|
|
||||||
String url = "https://bbps-staging.digiledge.in/agent/cou-master/masters/billersById?billerId=ADAN00000HAR02"; // Dummy public GET API
|
|
||||||
HashMap<String, String> response = httpService.getRequest(url);
|
|
||||||
System.out.println("✅ GET Response: " + response);
|
|
||||||
|
|
||||||
System.out.println(response);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user