Merge pull request 'adding FetchbillByBillId' (#3) from feature1 into develop
Reviewed-on: https://git.zeptic.in/himanshu/bbps/pulls/3
This commit is contained in:
@@ -1,24 +1,70 @@
|
||||
package com.billpaymentservice.bbps.controller;
|
||||
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.billpaymentservice.bbps.dto.GeneralResp;
|
||||
import com.billpaymentservice.bbps.dto.request.BillerDetailRequest;
|
||||
import com.billpaymentservice.bbps.dto.response.BillerDataResponse;
|
||||
import com.billpaymentservice.bbps.service.MasterDataService;
|
||||
|
||||
@RestController
|
||||
public class MasterDataController {
|
||||
|
||||
private final MasterDataService masterDataService;
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MasterDataController.class);
|
||||
public MasterDataController(MasterDataService masterDataService) {
|
||||
this.masterDataService = masterDataService;
|
||||
}
|
||||
@PostMapping(value = "/getBillerDetails",
|
||||
consumes = MediaType.APPLICATION_JSON_VALUE,
|
||||
produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<BillerDataResponse> getBillerDetails(
|
||||
@Validated @RequestBody BillerDetailRequest billerDetailRequest) {
|
||||
|
||||
@PostMapping("/getBillerById")
|
||||
public String getBillerById(@RequestBody BillerDetailRequest billerRequestRequest) {
|
||||
masterDataService.getBillerByBillerId(billerRequestRequest);
|
||||
return "Abc";
|
||||
log.info("Received biller details request for billerId: {}", billerDetailRequest.getBillerId());
|
||||
|
||||
BillerDataResponse response = masterDataService.getBillerByBillerId(billerDetailRequest);
|
||||
|
||||
HttpStatus status;
|
||||
String statusCode = response.getGeneralResp() != null ? response.getGeneralResp().getStatusCode() : "500";
|
||||
|
||||
switch (statusCode) {
|
||||
case "200":
|
||||
status = HttpStatus.OK;
|
||||
break;
|
||||
case "404":
|
||||
status = HttpStatus.NOT_FOUND;
|
||||
break;
|
||||
case "500":
|
||||
status = HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
break;
|
||||
default:
|
||||
status = HttpStatus.BAD_REQUEST;
|
||||
break;
|
||||
}
|
||||
|
||||
log.info("Returning response for billerId: {} with HTTP status: {}", billerDetailRequest.getBillerId(), status);
|
||||
|
||||
return new ResponseEntity<>(response, status);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.billpaymentservice.bbps.dto;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class AdditionalInfo {
|
||||
private String paramConfigId;
|
||||
private String paramName;
|
||||
private String dataTypeDAO;
|
||||
private String dataTypeModel;
|
||||
private boolean optional;
|
||||
private boolean visibility;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.billpaymentservice.bbps.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class AmountOption {
|
||||
private String amountOptionId;
|
||||
private List<String> amountBreakupSets;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.billpaymentservice.bbps.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class BillerDAO {
|
||||
private String billerId;
|
||||
private String billerName;
|
||||
private String billerAliasName;
|
||||
private String billerCategoryName;
|
||||
private String billerMode;
|
||||
private boolean billerAcceptsAdhoc;
|
||||
private boolean parentBiller;
|
||||
private String parentBillerId;
|
||||
private String billerOwnerShp;
|
||||
private String billerCoverage;
|
||||
private String fetchRequirement;
|
||||
private String paymentAmountExactness;
|
||||
private String supportBillValidation;
|
||||
private String billerEffctvFrom;
|
||||
private String billerEffctvTo;
|
||||
private String billerTempDeactivationStart;
|
||||
private String billerTempDeactivationEnd;
|
||||
|
||||
private List<PaymentMode> billerPaymentModes;
|
||||
private List<PaymentChannel> billerPaymentChannels;
|
||||
private List<CustomerParam> billerCustomerParams;
|
||||
private CustomerParamGroups customerParamGroups;
|
||||
private BillerResponseParams billerResponseParams;
|
||||
private List<AdditionalInfo> billerAdditionalInfos;
|
||||
private List<AdditionalInfo> billerAdditionalInfoPayments;
|
||||
private List<InterchangeFeeConf> interchangeFeeConves;
|
||||
private List<InterchangeFee> interchangeFees;
|
||||
|
||||
private String status;
|
||||
private String billerDescription;
|
||||
private String supportDeemed;
|
||||
private String supportPendingStatus;
|
||||
private String billerTimeOut;
|
||||
private String routeUrl;
|
||||
private String billerResponseType;
|
||||
private BillerPlanResponseParams billerPlanResponseParams;
|
||||
private String planMDMRequirement;
|
||||
private List<Object> planAdditionalInfos;
|
||||
private String upmsEnabled;
|
||||
private String clickpayEnabled;
|
||||
private String deemedSuccessEnabled;
|
||||
private String selectionType;
|
||||
|
||||
// getters and setters
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.billpaymentservice.bbps.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class BillerPlanResponseParams {
|
||||
private String billerPlanResponseId;
|
||||
private List<Object> params;
|
||||
private List<Object> amountOptions;
|
||||
|
||||
// getters and setters
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.billpaymentservice.bbps.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class BillerResponseParams {
|
||||
private String billerResponseId;
|
||||
private List<Object> params;
|
||||
private List<AmountOption> amountOptions;
|
||||
|
||||
// getters and setters
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.billpaymentservice.bbps.dto;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class CustomerParam {
|
||||
private String paramConfigId;
|
||||
private String paramName;
|
||||
private String dataTypeDAO;
|
||||
private String dataTypeModel;
|
||||
private boolean optional;
|
||||
private int minLength;
|
||||
private int maxLength;
|
||||
private String regex;
|
||||
private boolean visibility;
|
||||
|
||||
// getters and setters
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.billpaymentservice.bbps.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class CustomerParamGroups {
|
||||
private List<Group> groups;
|
||||
|
||||
// getters and setters
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.billpaymentservice.bbps.dto;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class GeneralResp {
|
||||
private String statusCode;
|
||||
private String status;
|
||||
private String message;
|
||||
private String remarks;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.billpaymentservice.bbps.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class Group {
|
||||
private String groupId;
|
||||
private List<String> params; // e.g., ["Admission No/Application No/GR No"]
|
||||
private List<Group> groups; // nested groups
|
||||
private String name; // group name
|
||||
private String input; // input count as string
|
||||
// getters and setters
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.billpaymentservice.bbps.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class InterchangeFee {
|
||||
private String interchangeFeeId;
|
||||
private String feeCode;
|
||||
private String feeDesc;
|
||||
private String feeDirection;
|
||||
private List<InterchangeFeeDetail> interchangeFeeDetails;
|
||||
|
||||
// getters and setters
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.billpaymentservice.bbps.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class InterchangeFeeConf {
|
||||
private String interChangeFeeConfId;
|
||||
private String mti;
|
||||
private String paymentMode;
|
||||
private String paymentChannel;
|
||||
private String responseCode;
|
||||
private List<String> fees;
|
||||
private boolean defaultFee;
|
||||
private String effctvFrom;
|
||||
private String effctvTo;
|
||||
|
||||
// getters and setters
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.billpaymentservice.bbps.dto;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class InterchangeFeeDetail {
|
||||
private String interchangeFeeDetId;
|
||||
private long tranAmtRangeMax;
|
||||
private long tranAmtRangeMin;
|
||||
private double percentFee;
|
||||
private double flatFee;
|
||||
private String effctvFrom;
|
||||
|
||||
// getters and setters
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.billpaymentservice.bbps.dto;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class PaymentChannel {
|
||||
private String paymentChannelLimitId;
|
||||
private String paymentChannel;
|
||||
private long maxLimit;
|
||||
private long minLimit;
|
||||
private String supportPendingStatus;
|
||||
|
||||
// getters and setters
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.billpaymentservice.bbps.dto;
|
||||
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class PaymentMode {
|
||||
private String paymentModelLimitId;
|
||||
private String paymentMode;
|
||||
private long maxLimit;
|
||||
private long minLimit;
|
||||
private String supportPendingStatus;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,8 +2,15 @@ package com.billpaymentservice.bbps.dto.request;
|
||||
|
||||
import com.billpaymentservice.bbps.entites.BaseClass;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class BillerDetailRequest extends BaseClass{
|
||||
|
||||
@NotNull
|
||||
private String billerId;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
package com.billpaymentservice.bbps.dto.response;
|
||||
|
||||
public class BillerDataResponse {
|
||||
import com.billpaymentservice.bbps.dto.BillerDAO;
|
||||
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 BillerDataResponse {
|
||||
private BillerDAO billerDAO;
|
||||
|
||||
private GeneralResp generalResp;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,8 @@ import lombok.Setter;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class BaseClass {
|
||||
|
||||
|
||||
|
||||
private String mid;
|
||||
private String secretKey;
|
||||
private String txnId;
|
||||
|
||||
@@ -1,21 +1,29 @@
|
||||
package com.billpaymentservice.bbps.exception;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import com.billpaymentservice.bbps.dto.GeneralResp;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class CustomException extends RuntimeException {
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
String message;
|
||||
public CustomException( String message) {
|
||||
super();
|
||||
|
||||
this.message = message;
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
private final GeneralResp generalResp;
|
||||
|
||||
public CustomException(String statusCode, String status,String message,String remark) {
|
||||
super(message);
|
||||
this.generalResp = new GeneralResp();
|
||||
this.generalResp.setStatusCode(statusCode);
|
||||
this.generalResp.setStatus(status);
|
||||
this.generalResp.setMessage(message);
|
||||
this.generalResp.setRemarks(remark);
|
||||
}
|
||||
public CustomException(String message) {
|
||||
super(message);
|
||||
this.generalResp = new GeneralResp();
|
||||
this.generalResp.setStatusCode("500");
|
||||
this.generalResp.setStatus("Failure");
|
||||
this.generalResp.setMessage(message);
|
||||
this.generalResp.setRemarks("");
|
||||
}
|
||||
public GeneralResp getGeneralResp() {
|
||||
return generalResp;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
package com.billpaymentservice.bbps.exception;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.ControllerAdvice;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import com.billpaymentservice.bbps.dto.GeneralResp;
|
||||
|
||||
@RestControllerAdvice
|
||||
@ControllerAdvice
|
||||
public class GlobalExceptionHandler {
|
||||
|
||||
|
||||
|
||||
@ExceptionHandler(CustomException.class)
|
||||
public ResponseEntity<GeneralResp> handleCustomException(CustomException ex) {
|
||||
return new ResponseEntity<>(ex.getGeneralResp(), HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.billpaymentservice.bbps.serviceImpl;
|
||||
|
||||
|
||||
import java.net.http.HttpClient;
|
||||
import java.time.Duration;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.http.client.JdkClientHttpRequestFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.time.Duration;
|
||||
import org.springframework.web.client.HttpClientErrorException;
|
||||
import org.springframework.web.client.HttpServerErrorException;
|
||||
import org.springframework.web.client.RestClient;
|
||||
|
||||
@Service
|
||||
public class HttpService {
|
||||
private static final Logger log = LoggerFactory.getLogger(HttpService.class);
|
||||
private final RestClient restClient;
|
||||
|
||||
HttpService() {
|
||||
HttpClient httpClient = HttpClient.newBuilder()
|
||||
.connectTimeout(Duration.ofSeconds(5))
|
||||
.build();
|
||||
|
||||
JdkClientHttpRequestFactory factory = new JdkClientHttpRequestFactory(httpClient);
|
||||
factory.setReadTimeout(Duration.ofSeconds(10));
|
||||
|
||||
this.restClient = RestClient.builder()
|
||||
.requestFactory(factory)
|
||||
.build();
|
||||
}
|
||||
|
||||
public HashMap<String, String> postRequest(String url, String payload) {
|
||||
HashMap<String, String> response = new HashMap<>();
|
||||
try {
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||
log.info("📡 Bank POST Request to URL: {}", url);
|
||||
|
||||
ResponseEntity<String> restResponse = restClient.post()
|
||||
.uri(url)
|
||||
.headers(h -> h.addAll(headers))
|
||||
.body(payload)
|
||||
.retrieve()
|
||||
.toEntity(String.class);
|
||||
|
||||
response.put("respCode", String.valueOf(restResponse.getStatusCode().value()));
|
||||
response.put("data", restResponse.getBody());
|
||||
|
||||
} catch (HttpClientErrorException | HttpServerErrorException httpException) {
|
||||
response.put("respCode", String.valueOf(httpException.getStatusCode()));
|
||||
response.put("data", "Exception : " + httpException.getResponseBodyAsString());
|
||||
} catch (Exception e) {
|
||||
response.put("data", "Exception :" + e.getMessage());
|
||||
log.error("❌ Exception during POST call to {} -> {}", url, e.getMessage());
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
public HashMap<String, String> getRequest(String url) {
|
||||
HashMap<String, String> response = new HashMap<>();
|
||||
try {
|
||||
log.info("🌐 Bank GET Request to URL: {}", url);
|
||||
|
||||
ResponseEntity<String> restResponse = restClient.get()
|
||||
.uri(url)
|
||||
.retrieve()
|
||||
.toEntity(String.class);
|
||||
|
||||
response.put("data", restResponse.getBody());
|
||||
|
||||
} catch (HttpClientErrorException | HttpServerErrorException httpException) {
|
||||
response.put("data", "Exception : " + httpException.getResponseBodyAsString());
|
||||
} catch (Exception e) {
|
||||
response.put("data", "Exception :" + e.getMessage());
|
||||
log.error("❌ Exception during GET call to {} -> {}", url, e.getMessage());
|
||||
}
|
||||
return response;
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,74 @@
|
||||
package com.billpaymentservice.bbps.serviceImpl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import com.billpaymentservice.bbps.dto.BillerDAO;
|
||||
import com.billpaymentservice.bbps.dto.GeneralResp;
|
||||
import com.billpaymentservice.bbps.dto.request.BillerDetailRequest;
|
||||
import com.billpaymentservice.bbps.dto.response.BillerDataResponse;
|
||||
import com.billpaymentservice.bbps.exception.CustomException;
|
||||
import com.billpaymentservice.bbps.service.MasterDataService;
|
||||
import com.billpaymentservice.bbps.serviceImpl.HttpService;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
public class MasterDataServiceImpl implements MasterDataService {
|
||||
|
||||
@Override
|
||||
public BillerDataResponse getBillerByBillerId(BillerDetailRequest billerDetailRequest) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Service
|
||||
public class MasterDataServiceImpl implements MasterDataService {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MasterDataServiceImpl.class);
|
||||
private final HttpService httpService;
|
||||
private final ObjectMapper objectMapper = new ObjectMapper();
|
||||
@Value("${bbps.billerDataFetch.url}")
|
||||
private String billerDataFetchUrl;
|
||||
|
||||
// Inject HttpService
|
||||
public MasterDataServiceImpl(HttpService httpService) {
|
||||
this.httpService = httpService;
|
||||
}
|
||||
@Override
|
||||
public BillerDataResponse getBillerByBillerId(BillerDetailRequest billerDetailRequest) {
|
||||
|
||||
|
||||
String billerId = billerDetailRequest.getBillerId();
|
||||
String url = billerDataFetchUrl + billerId;
|
||||
|
||||
Map<String, String> responseMap = httpService.getRequest(url);
|
||||
String responseData = responseMap.get("data");
|
||||
log.info("data is :{}",responseData);
|
||||
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
try {
|
||||
Map<String, Object> dataMap = objectMapper.readValue(responseData, new TypeReference<Map<String,Object>>() {});
|
||||
if (!dataMap.containsKey("generalResp")) {
|
||||
throw new CustomException(
|
||||
String.valueOf(dataMap.get("statusCode")),
|
||||
String.valueOf(dataMap.get("status")),
|
||||
String.valueOf(dataMap.get("message")),
|
||||
String.valueOf(dataMap.get("remarks")));
|
||||
}
|
||||
BillerDataResponse responseWrapper = objectMapper.convertValue(dataMap, BillerDataResponse.class);
|
||||
return responseWrapper;
|
||||
|
||||
} catch (JsonProcessingException e) {
|
||||
log.error("Error parsing responseData JSON: {}", e.getMessage());
|
||||
throw new CustomException("Invalid JSON received from API");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@ spring.jpa.hibernate.ddl-auto=update
|
||||
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
|
||||
|
||||
# DataSource
|
||||
spring.datasource.url=jdbc:postgresql://localhost:5432/personalPractice
|
||||
spring.datasource.url=jdbc:postgresql://localhost:5432/TestingDB
|
||||
spring.datasource.username=postgres
|
||||
spring.datasource.password=Admin123
|
||||
spring.datasource.password=thakur@123
|
||||
spring.datasource.driver-class-name=org.postgresql.Driver
|
||||
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
|
||||
|
||||
@@ -29,11 +29,8 @@ logging.level.io.github.resilience4j.retry=DEBUG
|
||||
certificate.path=D:/Switch Document/rbl_lincpay/rbl_lincpay.pfx
|
||||
certificate.password=lincpay
|
||||
|
||||
# NPCI URLs
|
||||
npci.respPay.url=https://globalcertzone.npci.org.in:443/imps/RespPay/2.0/urn:txnid:
|
||||
npci.respChkTxn.url=https://globalcertzone.npci.org.in:443/imps/RespChkTxn/2.0/urn:txnid:
|
||||
npci.respValAdd.url=https://globalcertzone.npci.org.in:443/imps/RespValAdd/2.0/urn:txnid:
|
||||
npci.ack.schemas=src/main/resources/schemas/imps_ack.xsd
|
||||
# BBPS URLs
|
||||
bbps.billerDataFetch.url=https://bbps-staging.digiledge.in/agent/cou-master/masters/billersById?billerId=
|
||||
|
||||
# Resilience4j Retry
|
||||
resilience4j.retry.instances.callbackService.max-attempts=1
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
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