Merge pull request 'feature3-shared' (#17) from feature3-shared into develop
Reviewed-on: https://git.zeptic.in/himanshu/bbps/pulls/17
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
<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>
|
||||||
@@ -29,11 +29,11 @@
|
|||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter</artifactId>
|
<artifactId>spring-boot-starter</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- Validation -->
|
<!-- Validation -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-validation</artifactId>
|
<artifactId>spring-boot-starter-validation</artifactId>
|
||||||
</dependency>
|
</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>
|
||||||
@@ -62,6 +62,11 @@
|
|||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-security</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Database Driver -->
|
<!-- Database Driver -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.postgresql</groupId>
|
<groupId>org.postgresql</groupId>
|
||||||
@@ -133,7 +138,26 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springdoc</groupId>
|
<groupId>org.springdoc</groupId>
|
||||||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||||||
<version>2.5.0</version>
|
<version>2.2.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- JWT Runtime Implementations -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
|
<artifactId>jjwt-api</artifactId>
|
||||||
|
<version>0.11.5</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
|
<artifactId>jjwt-impl</artifactId>
|
||||||
|
<version>0.11.5</version>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
|
<artifactId>jjwt-jackson</artifactId>
|
||||||
|
<version>0.11.5</version>
|
||||||
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Test -->
|
<!-- Test -->
|
||||||
@@ -172,8 +196,8 @@
|
|||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
|
|
||||||
</plugins>
|
</plugins>
|
||||||
<finalName>BBPS</finalName>
|
<finalName>BBPS</finalName>
|
||||||
</build>
|
</build>
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.billpaymentservice.bbps.config;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.core.userdetails.User;
|
||||||
|
import org.springframework.security.core.userdetails.UserDetails;
|
||||||
|
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||||
|
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.billpaymentservice.bbps.entites.UserEntity;
|
||||||
|
import com.billpaymentservice.bbps.entites.UsersDetails;
|
||||||
|
import com.billpaymentservice.bbps.repository.UserRepository;
|
||||||
|
import com.billpaymentservice.bbps.repository.UsersDetailsRepository;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class CustomUserDetailsService implements UserDetailsService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private UserRepository userRepository;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UserDetails loadUserByUsername(String userMobNo) throws UsernameNotFoundException {
|
||||||
|
|
||||||
|
Optional<UserEntity> adminOptional = userRepository.findByMobile(userMobNo);
|
||||||
|
|
||||||
|
if (adminOptional.isPresent()) {
|
||||||
|
UserEntity user = adminOptional.get();
|
||||||
|
return new User(user.getMobile(), user.getName(), new ArrayList<>());
|
||||||
|
} else {
|
||||||
|
throw new UsernameNotFoundException("User not found with MobNo: " + userMobNo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package com.billpaymentservice.bbps.config;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import org.springframework.security.core.AuthenticationException;
|
||||||
|
import org.springframework.security.web.AuthenticationEntryPoint;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import jakarta.servlet.ServletException;
|
||||||
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class JwtAuthenticationEntryPoint implements AuthenticationEntryPoint {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void commence(HttpServletRequest request, HttpServletResponse response,
|
||||||
|
AuthenticationException authException) throws IOException, ServletException {
|
||||||
|
response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Access denied");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
package com.billpaymentservice.bbps.config;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||||
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
|
import org.springframework.security.core.userdetails.UserDetails;
|
||||||
|
import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.filter.OncePerRequestFilter;
|
||||||
|
import io.jsonwebtoken.ExpiredJwtException;
|
||||||
|
import io.jsonwebtoken.MalformedJwtException;
|
||||||
|
import jakarta.servlet.FilterChain;
|
||||||
|
import jakarta.servlet.ServletException;
|
||||||
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class JwtFilter extends OncePerRequestFilter {
|
||||||
|
|
||||||
|
private final JwtUtil jwtUtil;
|
||||||
|
|
||||||
|
private final CustomUserDetailsService userDetailsService;
|
||||||
|
|
||||||
|
public JwtFilter(JwtUtil jwtUtil, CustomUserDetailsService userDetailsService) {
|
||||||
|
this.jwtUtil = jwtUtil;
|
||||||
|
this.userDetailsService = userDetailsService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
|
||||||
|
throws ServletException, IOException {
|
||||||
|
|
||||||
|
final String authorizationHeader = request.getHeader("Authentication");
|
||||||
|
|
||||||
|
String mobileNo = null;
|
||||||
|
String jwt = null;
|
||||||
|
|
||||||
|
if (authorizationHeader != null && authorizationHeader.startsWith("Bearer ")) {
|
||||||
|
jwt = authorizationHeader.substring(7);
|
||||||
|
try {
|
||||||
|
mobileNo = jwtUtil.extractUsername(jwt);
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
System.out.println("unable to get jwt tokken");
|
||||||
|
} catch (ExpiredJwtException e) {
|
||||||
|
System.out.println("Jwt Exception jwt tokken");
|
||||||
|
} catch (MalformedJwtException e) {
|
||||||
|
System.out.println("invelid jwt token");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mobileNo != null && SecurityContextHolder.getContext().getAuthentication() == null) {
|
||||||
|
|
||||||
|
UserDetails userDetails = this.userDetailsService.loadUserByUsername(mobileNo);
|
||||||
|
|
||||||
|
if (jwtUtil.validateToken(jwt, userDetails)) {
|
||||||
|
|
||||||
|
UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(
|
||||||
|
userDetails, null, userDetails.getAuthorities());
|
||||||
|
authentication.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
|
||||||
|
SecurityContextHolder.getContext().setAuthentication(authentication);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
System.out.println("JWT Filter: Token validation failed for user - " + mobileNo);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
filterChain.doFilter(request, response);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
package com.billpaymentservice.bbps.config;
|
||||||
|
|
||||||
|
import java.security.Key;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.security.core.userdetails.UserDetails;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.billpaymentservice.bbps.util.BBPSConstant;
|
||||||
|
|
||||||
|
import io.jsonwebtoken.Claims;
|
||||||
|
import io.jsonwebtoken.Jwts;
|
||||||
|
import io.jsonwebtoken.SignatureAlgorithm;
|
||||||
|
import io.jsonwebtoken.io.Decoders;
|
||||||
|
import io.jsonwebtoken.security.Keys;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class JwtUtil {
|
||||||
|
|
||||||
|
@Value("${jwt.secret}")
|
||||||
|
private String secret;
|
||||||
|
|
||||||
|
private final Map<String, Date> tokenBlacklist = new HashMap<>();
|
||||||
|
|
||||||
|
private Key getSigningKey() {
|
||||||
|
byte[] keyBytes = Decoders.BASE64.decode(secret);
|
||||||
|
return Keys.hmacShaKeyFor(keyBytes);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String generateToken(String username, String mid) {
|
||||||
|
Map<String, Object> claims = new HashMap<>();
|
||||||
|
claims.put("mid", mid);
|
||||||
|
claims.put("expiryTime", new Date(System.currentTimeMillis() + BBPSConstant.JWT_EXPIRATION_MS).toString());
|
||||||
|
return createToken(claims, username.toUpperCase());
|
||||||
|
}
|
||||||
|
|
||||||
|
public String doGenerateRefreshToken(Map<String, Object> claims, String subject) {
|
||||||
|
return Jwts.builder().setClaims(claims).setSubject(subject).setIssuedAt(new Date(System.currentTimeMillis()))
|
||||||
|
.setExpiration(new Date(System.currentTimeMillis() + BBPSConstant.REFRESH_EXPIRATION_MS))
|
||||||
|
.signWith(getSigningKey(), SignatureAlgorithm.HS512).compact();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String extractUsername(String token) {
|
||||||
|
return extractClaim(token, Claims::getSubject);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date extractExpiration(String token) {
|
||||||
|
return extractClaim(token, Claims::getExpiration);
|
||||||
|
}
|
||||||
|
|
||||||
|
public <T> T extractClaim(String token, Function<Claims, T> claimsResolver) {
|
||||||
|
final Claims claims = extractAllClaims(token);
|
||||||
|
return claimsResolver.apply(claims);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Claims extractAllClaims(String token) {
|
||||||
|
return Jwts.parserBuilder().setSigningKey(getSigningKey()).build().parseClaimsJws(token).getBody();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Boolean isTokenExpired(String token) {
|
||||||
|
return extractExpiration(token).before(new Date());
|
||||||
|
}
|
||||||
|
|
||||||
|
private String createToken(Map<String, Object> claims, String subject) {
|
||||||
|
return Jwts.builder().setClaims(claims).setSubject(subject).setIssuedAt(new Date(System.currentTimeMillis()))
|
||||||
|
.setExpiration(new Date(System.currentTimeMillis() + BBPSConstant.JWT_EXPIRATION_MS))
|
||||||
|
.signWith(getSigningKey(), SignatureAlgorithm.HS512).compact();
|
||||||
|
}
|
||||||
|
|
||||||
|
private String createToken1(Map<String, Object> claims,String subject) {
|
||||||
|
return Jwts.builder().setClaims(claims).setSubject(subject).setIssuedAt(new Date(System.currentTimeMillis()))
|
||||||
|
.setExpiration(new Date(System.currentTimeMillis() + 1000 * 60 * 60 * 10))
|
||||||
|
.signWith(getSigningKey(), SignatureAlgorithm.HS512).compact();
|
||||||
|
}
|
||||||
|
|
||||||
|
// public Boolean validateToken(String token, UserDetails userDetails) {
|
||||||
|
// final String username = extractUsername(token);
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
|
||||||
|
public Boolean validateToken(String token, UserDetails userDetails) {
|
||||||
|
final String mobileNo = extractUsername(token);
|
||||||
|
// System.out.println("Extracted mobileNo from token: " + mobileNo );
|
||||||
|
// System.out.println("Username from UserDetails: " + userDetails.getUsername());
|
||||||
|
return (mobileNo .equals(userDetails.getUsername()) && !isTokenExpired(token));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void invalidateToken(String token) {
|
||||||
|
tokenBlacklist.put(token, new Date());
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isTokenBlacklisted(String token) {
|
||||||
|
Date invalidationTime = tokenBlacklist.get(token);
|
||||||
|
return invalidationTime != null && invalidationTime.before(new Date());
|
||||||
|
}
|
||||||
|
|
||||||
|
public String generateToken(String mobileNo) {
|
||||||
|
Map<String, Object> claims = new HashMap<>();
|
||||||
|
claims.put("mobileNo", mobileNo);
|
||||||
|
return createToken1(claims,mobileNo);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -3,15 +3,52 @@ package com.billpaymentservice.bbps.config;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.ComponentScan;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.http.HttpMethod;
|
||||||
|
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||||
|
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||||
|
import org.springframework.security.config.http.SessionCreationPolicy;
|
||||||
|
import org.springframework.security.web.SecurityFilterChain;
|
||||||
|
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
|
||||||
import org.springframework.web.cors.CorsConfiguration;
|
import org.springframework.web.cors.CorsConfiguration;
|
||||||
import org.springframework.web.cors.CorsConfigurationSource;
|
import org.springframework.web.cors.CorsConfigurationSource;
|
||||||
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
|
@EnableWebSecurity
|
||||||
public class SecurityConfig {
|
public class SecurityConfig {
|
||||||
|
|
||||||
|
private final JwtAuthenticationEntryPoint jwtAuthenticationEntryPoint;
|
||||||
|
|
||||||
|
private final JwtFilter jwtFilter;
|
||||||
|
|
||||||
|
public SecurityConfig(JwtAuthenticationEntryPoint jwtAuthenticationEntryPoint, JwtFilter jwtFilter) {
|
||||||
|
this.jwtAuthenticationEntryPoint = jwtAuthenticationEntryPoint;
|
||||||
|
this.jwtFilter = jwtFilter;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
||||||
|
|
||||||
|
http.csrf(csrf -> csrf.disable()).cors(cors -> cors.configurationSource(corsConfigurationSource()))
|
||||||
|
.authorizeHttpRequests(auth -> auth
|
||||||
|
.requestMatchers("/auth/**",
|
||||||
|
"/v3/api-docs/**",
|
||||||
|
"/swagger-ui/**",
|
||||||
|
"/swagger-ui.html",
|
||||||
|
"/swagger-resources/**",
|
||||||
|
"/webjars/**",
|
||||||
|
"/error")
|
||||||
|
.permitAll().requestMatchers(HttpMethod.OPTIONS, "/**").permitAll()
|
||||||
|
.anyRequest().authenticated())
|
||||||
|
.exceptionHandling(ex -> ex.authenticationEntryPoint(jwtAuthenticationEntryPoint))
|
||||||
|
.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS));
|
||||||
|
|
||||||
|
http.addFilterBefore(jwtFilter, UsernamePasswordAuthenticationFilter.class);
|
||||||
|
|
||||||
|
return http.build();
|
||||||
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public CorsConfigurationSource corsConfigurationSource() {
|
public CorsConfigurationSource corsConfigurationSource() {
|
||||||
CorsConfiguration config = new CorsConfiguration();
|
CorsConfiguration config = new CorsConfiguration();
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package com.billpaymentservice.bbps.controller;
|
||||||
|
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import com.billpaymentservice.bbps.dto.ResponseModel;
|
||||||
|
import com.billpaymentservice.bbps.dto.auth.AuthResponse;
|
||||||
|
import com.billpaymentservice.bbps.dto.response.AuthResponses;
|
||||||
|
import com.billpaymentservice.bbps.dto.auth.LoginRequest;
|
||||||
|
import com.billpaymentservice.bbps.dto.auth.OtpSendResponse;
|
||||||
|
import com.billpaymentservice.bbps.dto.auth.RegisterRequest;
|
||||||
|
import com.billpaymentservice.bbps.dto.auth.VerifyOtpRequest;
|
||||||
|
import com.billpaymentservice.bbps.service.AuthService;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/auth")
|
||||||
|
@CrossOrigin(origins = "*")
|
||||||
|
@Slf4j
|
||||||
|
public class AuthController {
|
||||||
|
|
||||||
|
private final AuthService authService;
|
||||||
|
|
||||||
|
public AuthController(AuthService authService) {
|
||||||
|
this.authService = authService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/sendOtp", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public ResponseEntity<ResponseModel> sendOtp(@Validated @RequestBody LoginRequest request) {
|
||||||
|
log.info("Received sendOtp request for mobile: {}", request.getMobile());
|
||||||
|
return ResponseEntity.ok(authService.sendOtp(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/verifyOtp", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public ResponseEntity<ResponseModel> verifyOtp(@Validated @RequestBody VerifyOtpRequest request) {
|
||||||
|
|
||||||
|
return ResponseEntity.ok(authService.verifyOtp(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/register", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public ResponseEntity<ResponseModel> register(@Validated @RequestBody RegisterRequest request) {
|
||||||
|
|
||||||
|
return ResponseEntity.ok(authService.registerUser(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/loginWithoutDecryption")
|
||||||
|
public ResponseEntity<ResponseModel> login(@RequestBody LoginRequest loginRequest) {
|
||||||
|
|
||||||
|
return ResponseEntity.ok(authService.authenticateUser(loginRequest));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -16,9 +16,11 @@ import com.billpaymentservice.bbps.dto.request.BillerDetailRequest;
|
|||||||
import com.billpaymentservice.bbps.dto.request.ContactMasterRequest;
|
import com.billpaymentservice.bbps.dto.request.ContactMasterRequest;
|
||||||
import com.billpaymentservice.bbps.dto.request.CustomParamRequest;
|
import com.billpaymentservice.bbps.dto.request.CustomParamRequest;
|
||||||
import com.billpaymentservice.bbps.dto.request.DispositionRequest;
|
import com.billpaymentservice.bbps.dto.request.DispositionRequest;
|
||||||
|
import com.billpaymentservice.bbps.dto.request.LoginRequest;
|
||||||
import com.billpaymentservice.bbps.dto.request.MasterCategoryRequest;
|
import com.billpaymentservice.bbps.dto.request.MasterCategoryRequest;
|
||||||
import com.billpaymentservice.bbps.dto.request.MasterRequest;
|
import com.billpaymentservice.bbps.dto.request.MasterRequest;
|
||||||
import com.billpaymentservice.bbps.dto.request.PlanRequest;
|
import com.billpaymentservice.bbps.dto.request.PlanRequest;
|
||||||
|
import com.billpaymentservice.bbps.dto.response.AuthResponses;
|
||||||
import com.billpaymentservice.bbps.service.MasterDataService;
|
import com.billpaymentservice.bbps.service.MasterDataService;
|
||||||
|
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
|
|||||||
@@ -54,11 +54,13 @@ public class PaymentController {
|
|||||||
return ResponseEntity.ok(response);
|
return ResponseEntity.ok(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@PostMapping(value="/callback/paymentIntiate", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
@PostMapping(value="/callback/paymentIntiate", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
public ResponseEntity<ResponseModel> handleBillValidateCallback(@RequestBody TransactionStatusResponse transactionStatusResponse) {
|
public ResponseEntity<ResponseModel> handleBillValidateCallback(@RequestBody TransactionStatusResponse transactionStatusResponse) {
|
||||||
ResponseModel genralResp=paymentService.handlePaymentIntiateCallback(transactionStatusResponse);
|
ResponseModel genralResp=paymentService.handlePaymentIntiateCallback(transactionStatusResponse);
|
||||||
// Return a response indicating successful receipt
|
// Return a response indicating successful receipt
|
||||||
return ResponseEntity.ok(genralResp);
|
return ResponseEntity.ok(genralResp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.billpaymentservice.bbps.dto;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class UserDetailsDTO {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private String userEmailId;
|
||||||
|
|
||||||
|
private String userMobNo;
|
||||||
|
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
private String userAge;
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.billpaymentservice.bbps.dto.auth;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
|
public class AuthResponse {
|
||||||
|
private boolean success;
|
||||||
|
private String message;
|
||||||
|
private boolean userExists;
|
||||||
|
private UserDto user;
|
||||||
|
private String token;
|
||||||
|
|
||||||
|
public AuthResponse(boolean success, String message, boolean userExists, UserDto user) {
|
||||||
|
this.success = success;
|
||||||
|
this.message = message;
|
||||||
|
this.userExists = userExists;
|
||||||
|
this.user = user;
|
||||||
|
}
|
||||||
|
public AuthResponse(boolean success, String message, String token) {
|
||||||
|
this.success = success;
|
||||||
|
this.message = message;
|
||||||
|
this.token = token;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.billpaymentservice.bbps.dto.auth;
|
||||||
|
|
||||||
|
public class LoginRequest {
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
public LoginRequest() {}
|
||||||
|
|
||||||
|
public LoginRequest(String mobile) {
|
||||||
|
this.mobile = mobile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMobile() {
|
||||||
|
return mobile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMobile(String mobile) {
|
||||||
|
this.mobile = mobile;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.billpaymentservice.bbps.dto.auth;
|
||||||
|
|
||||||
|
public class OtpSendResponse {
|
||||||
|
private boolean success;
|
||||||
|
private String message;
|
||||||
|
|
||||||
|
public OtpSendResponse() {}
|
||||||
|
|
||||||
|
public OtpSendResponse(boolean success, String message) {
|
||||||
|
this.success = success;
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isSuccess() {
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSuccess(boolean success) {
|
||||||
|
this.success = success;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMessage() {
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMessage(String message) {
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.billpaymentservice.bbps.dto.auth;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class RegisterRequest {
|
||||||
|
private String mobile;
|
||||||
|
private String name;
|
||||||
|
private String email;
|
||||||
|
private String age;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.billpaymentservice.bbps.dto.auth;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class UserDto {
|
||||||
|
private Long id;
|
||||||
|
private String mobile;
|
||||||
|
private String name;
|
||||||
|
private String email;
|
||||||
|
private String age;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.billpaymentservice.bbps.dto.auth;
|
||||||
|
|
||||||
|
public class VerifyOtpRequest {
|
||||||
|
private String mobile;
|
||||||
|
private String otp;
|
||||||
|
|
||||||
|
public VerifyOtpRequest() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public VerifyOtpRequest(String mobile, String otp) {
|
||||||
|
this.mobile = mobile;
|
||||||
|
this.otp = otp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMobile() {
|
||||||
|
return mobile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMobile(String mobile) {
|
||||||
|
this.mobile = mobile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOtp() {
|
||||||
|
return otp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOtp(String otp) {
|
||||||
|
this.otp = otp;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -30,6 +30,9 @@ public abstract class BaseClass {
|
|||||||
@NotBlank(message = "Request ID cannot be null or blank")
|
@NotBlank(message = "Request ID cannot be null or blank")
|
||||||
private String reqId;
|
private String reqId;
|
||||||
|
|
||||||
|
@JsonProperty("userId")
|
||||||
|
private String clientUserId;
|
||||||
|
|
||||||
private DeviceDetail deviceDetial;
|
private DeviceDetail deviceDetial;
|
||||||
// ✅ 10 User Defined Fields (UDF1–UDF10)
|
// ✅ 10 User Defined Fields (UDF1–UDF10)
|
||||||
private String udf1;
|
private String udf1;
|
||||||
|
|||||||
@@ -11,7 +11,5 @@ public class ComplaintRequestDTO extends BaseClass {
|
|||||||
private String ticketDisposition; // Complaint disposition
|
private String ticketDisposition; // Complaint disposition
|
||||||
private String ticketDispositionCode; // Type of complaint
|
private String ticketDispositionCode; // Type of complaint
|
||||||
private String txnId; // Transaction ID (optional)
|
private String txnId; // Transaction ID (optional)
|
||||||
private String billerId; // Client Req ID (optional);
|
|
||||||
private String billerName;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.billpaymentservice.bbps.dto.request;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.Pattern;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class LoginRequest {
|
||||||
|
|
||||||
|
@NotBlank(message = "Mobile number is required")
|
||||||
|
@Pattern(regexp = "^[6-9]\\d{9}$", message = "Invalid mobile number. It must be 10 digits and start with 6, 7, 8, or 9.")
|
||||||
|
private String mobileNumber;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package com.billpaymentservice.bbps.dto.request;
|
||||||
|
|
||||||
|
public class TransactionHistory {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.billpaymentservice.bbps.dto.response;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class AuthResponses {
|
||||||
|
|
||||||
|
private String token;
|
||||||
|
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
private String message;
|
||||||
|
|
||||||
|
private int statusCode;
|
||||||
|
|
||||||
|
private Object data;
|
||||||
|
|
||||||
|
private String anotherData;
|
||||||
|
|
||||||
|
// Constructor
|
||||||
|
public AuthResponses(String status, String message, int statusCode, String token) {
|
||||||
|
|
||||||
|
this.status = status;
|
||||||
|
this.message = message;
|
||||||
|
this.statusCode = statusCode;
|
||||||
|
this.token = token;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AuthResponses(String token, String status, String message, int statusCode, Object data) {
|
||||||
|
this.token = token;
|
||||||
|
this.status = status;
|
||||||
|
this.message = message;
|
||||||
|
this.statusCode = statusCode;
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -22,6 +22,12 @@ public class PaymentInitiate {
|
|||||||
|
|
||||||
@Column(name = "bank_txn_Id", nullable = false)
|
@Column(name = "bank_txn_Id", nullable = false)
|
||||||
private String bankTxnId;
|
private String bankTxnId;
|
||||||
|
|
||||||
|
@Column(name = "client_user_id")
|
||||||
|
private String clientUserId;
|
||||||
|
|
||||||
|
@Column(name = "mid")
|
||||||
|
private String mid;
|
||||||
|
|
||||||
@Column(name = "txn_id")
|
@Column(name = "txn_id")
|
||||||
private String txnId;
|
private String txnId;
|
||||||
|
|||||||
@@ -35,6 +35,12 @@ public class TransactionMaster {
|
|||||||
// 👇 Apna internal transaction id, manually generate or system ke through
|
// 👇 Apna internal transaction id, manually generate or system ke through
|
||||||
@Column(name = "txn_id")
|
@Column(name = "txn_id")
|
||||||
private String txnId;
|
private String txnId;
|
||||||
|
|
||||||
|
@Column(name = "client_user_id")
|
||||||
|
private String clientUserId;
|
||||||
|
|
||||||
|
@Column(name = "mid")
|
||||||
|
private String mid;
|
||||||
|
|
||||||
@Column(name = "req_id")
|
@Column(name = "req_id")
|
||||||
private String reqId;
|
private String reqId;
|
||||||
@@ -148,7 +154,7 @@ public class TransactionMaster {
|
|||||||
|
|
||||||
@Column(name = "plan_type")
|
@Column(name = "plan_type")
|
||||||
private String planType;
|
private String planType;
|
||||||
|
|
||||||
@Column(name = "creation_date")
|
@Column(name = "creation_date")
|
||||||
private String creationDate;
|
private String creationDate;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.billpaymentservice.bbps.entites;
|
||||||
|
|
||||||
|
import com.billpaymentservice.bbps.audit.Auditable;
|
||||||
|
|
||||||
|
import jakarta.persistence.Column;
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.GenerationType;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
import jakarta.persistence.Table;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "users")
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class UserEntity extends Auditable<String> {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Column(name = "mobile", nullable = false, unique = true, length = 20)
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
@Column(name = "name", length = 150)
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Column(name = "email", length = 150)
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
@Column(name = "age")
|
||||||
|
private String age;
|
||||||
|
|
||||||
|
public UserEntity(String mobile, String name, String email, String age) {
|
||||||
|
this.mobile = mobile;
|
||||||
|
this.name = name;
|
||||||
|
this.email = email;
|
||||||
|
this.age = age;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package com.billpaymentservice.bbps.entites;
|
||||||
|
|
||||||
|
import com.billpaymentservice.bbps.audit.Auditable;
|
||||||
|
import jakarta.persistence.Column;
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.GenerationType;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
import jakarta.persistence.Table;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Entity
|
||||||
|
@Table(name = "user_details")
|
||||||
|
public class UsersDetails extends Auditable<String> {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@Column(name = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Column(name = "user_email_id")
|
||||||
|
private String userEmailId;
|
||||||
|
|
||||||
|
@Column(name = "user_mob_no")
|
||||||
|
private String userMobNo;
|
||||||
|
|
||||||
|
@Column(name = "user_name")
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
@Column(name = "user_age")
|
||||||
|
private String userAge;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.billpaymentservice.bbps.repository;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import com.billpaymentservice.bbps.entites.UserEntity;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface UserRepository extends JpaRepository<UserEntity, Long> {
|
||||||
|
Optional<UserEntity> findByMobile(String mobile);
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.billpaymentservice.bbps.repository;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.security.core.userdetails.UserDetails;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import com.billpaymentservice.bbps.entites.UsersDetails;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface UsersDetailsRepository extends JpaRepository<UsersDetails, Long> {
|
||||||
|
|
||||||
|
Optional<UsersDetails> findByUserMobNo(String userMobNo);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package com.billpaymentservice.bbps.service;
|
||||||
|
|
||||||
|
import com.billpaymentservice.bbps.dto.ResponseModel;
|
||||||
|
import com.billpaymentservice.bbps.dto.auth.AuthResponse;
|
||||||
|
import com.billpaymentservice.bbps.dto.auth.LoginRequest;
|
||||||
|
import com.billpaymentservice.bbps.dto.auth.OtpSendResponse;
|
||||||
|
import com.billpaymentservice.bbps.dto.auth.RegisterRequest;
|
||||||
|
import com.billpaymentservice.bbps.dto.auth.VerifyOtpRequest;
|
||||||
|
import com.billpaymentservice.bbps.dto.response.AuthResponses;
|
||||||
|
import com.billpaymentservice.bbps.entites.UserEntity;
|
||||||
|
|
||||||
|
public interface AuthService {
|
||||||
|
ResponseModel<?> sendOtp(LoginRequest request);
|
||||||
|
|
||||||
|
ResponseModel<?> verifyOtp(VerifyOtpRequest request);
|
||||||
|
|
||||||
|
ResponseModel<?> registerUser(RegisterRequest request);
|
||||||
|
|
||||||
|
UserEntity findByMobile(String mobile);
|
||||||
|
|
||||||
|
ResponseModel<?> authenticateUser(LoginRequest loginRequest);
|
||||||
|
}
|
||||||
@@ -5,9 +5,11 @@ import com.billpaymentservice.bbps.dto.request.BillerDetailRequest;
|
|||||||
import com.billpaymentservice.bbps.dto.request.ContactMasterRequest;
|
import com.billpaymentservice.bbps.dto.request.ContactMasterRequest;
|
||||||
import com.billpaymentservice.bbps.dto.request.CustomParamRequest;
|
import com.billpaymentservice.bbps.dto.request.CustomParamRequest;
|
||||||
import com.billpaymentservice.bbps.dto.request.DispositionRequest;
|
import com.billpaymentservice.bbps.dto.request.DispositionRequest;
|
||||||
|
import com.billpaymentservice.bbps.dto.request.LoginRequest;
|
||||||
import com.billpaymentservice.bbps.dto.request.MasterCategoryRequest;
|
import com.billpaymentservice.bbps.dto.request.MasterCategoryRequest;
|
||||||
import com.billpaymentservice.bbps.dto.request.MasterRequest;
|
import com.billpaymentservice.bbps.dto.request.MasterRequest;
|
||||||
import com.billpaymentservice.bbps.dto.request.PlanRequest;
|
import com.billpaymentservice.bbps.dto.request.PlanRequest;
|
||||||
|
import com.billpaymentservice.bbps.dto.response.AuthResponses;
|
||||||
|
|
||||||
public interface MasterDataService {
|
public interface MasterDataService {
|
||||||
|
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ public class AgentServiceImpl implements AgentService {
|
|||||||
String apiName = BBPSConstant.API_INITIATE_BILL_VALIDATE;
|
String apiName = BBPSConstant.API_INITIATE_BILL_VALIDATE;
|
||||||
String reqId = fetchBillValidateRequest.getReqId();
|
String reqId = fetchBillValidateRequest.getReqId();
|
||||||
String mid = fetchBillValidateRequest.getMid();
|
String mid = fetchBillValidateRequest.getMid();
|
||||||
LOGGER.info("[{}] START | reqId={} | mid={} | billerId={}", apiName, fetchBillValidateRequest, mid,
|
LOGGER.info("[{}] START | reqId={} | mid={} | billerId={}", apiName, fetchBillValidateRequest.getReqId(), mid,
|
||||||
fetchBillValidateRequest.getBillerId());
|
fetchBillValidateRequest.getBillerId());
|
||||||
String txnId = helper.generateTxnId(15);
|
String txnId = helper.generateTxnId(15);
|
||||||
String fullUrl = agentDtaUrl + BBPSConstant.BILLER_VALIDATE_URL;
|
String fullUrl = agentDtaUrl + BBPSConstant.BILLER_VALIDATE_URL;
|
||||||
@@ -395,8 +395,6 @@ public class AgentServiceImpl implements AgentService {
|
|||||||
helper.updateInboundLogSuccess(inboundLog, responseData, generalResp.getStatus());
|
helper.updateInboundLogSuccess(inboundLog, responseData, generalResp.getStatus());
|
||||||
System.out.println("responseWrapper:" + responseWrapper);
|
System.out.println("responseWrapper:" + responseWrapper);
|
||||||
mapperHelper.saveBillValidation(responseWrapper, billRequest);
|
mapperHelper.saveBillValidation(responseWrapper, billRequest);
|
||||||
LOGGER.info("Bill data saved successfully for billId: {}", billId);
|
|
||||||
|
|
||||||
return new ResponseModel(generalResp.getMessage(), generalResp.getStatus(),
|
return new ResponseModel(generalResp.getMessage(), generalResp.getStatus(),
|
||||||
Integer.parseInt(generalResp.getStatusCode()), responseWrapper);
|
Integer.parseInt(generalResp.getStatusCode()), responseWrapper);
|
||||||
} catch (JsonProcessingException e) {
|
} catch (JsonProcessingException e) {
|
||||||
|
|||||||
@@ -0,0 +1,179 @@
|
|||||||
|
package com.billpaymentservice.bbps.serviceImpl;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.core.userdetails.UserDetails;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import com.billpaymentservice.bbps.config.JwtUtil;
|
||||||
|
import com.billpaymentservice.bbps.dto.UserDetailsDTO;
|
||||||
|
import com.billpaymentservice.bbps.dto.ResponseModel;
|
||||||
|
import com.billpaymentservice.bbps.dto.auth.AuthResponse;
|
||||||
|
import com.billpaymentservice.bbps.dto.auth.LoginRequest;
|
||||||
|
import com.billpaymentservice.bbps.dto.auth.OtpSendResponse;
|
||||||
|
import com.billpaymentservice.bbps.dto.auth.RegisterRequest;
|
||||||
|
import com.billpaymentservice.bbps.dto.auth.UserDto;
|
||||||
|
import com.billpaymentservice.bbps.dto.auth.VerifyOtpRequest;
|
||||||
|
import com.billpaymentservice.bbps.dto.response.AuthResponses;
|
||||||
|
import com.billpaymentservice.bbps.entites.UserEntity;
|
||||||
|
import com.billpaymentservice.bbps.entites.UsersDetails;
|
||||||
|
import com.billpaymentservice.bbps.repository.UserRepository;
|
||||||
|
import com.billpaymentservice.bbps.repository.UsersDetailsRepository;
|
||||||
|
import com.billpaymentservice.bbps.service.AuthService;
|
||||||
|
import com.billpaymentservice.bbps.util.Helper;
|
||||||
|
import com.billpaymentservice.bbps.util.OtpClient;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class AuthServiceImpl implements AuthService {
|
||||||
|
|
||||||
|
private static final Logger LOGGER = LoggerFactory.getLogger(AuthServiceImpl.class);
|
||||||
|
|
||||||
|
private final UserRepository userRepository;
|
||||||
|
private final OtpClient otpClient;
|
||||||
|
private final Helper helper;
|
||||||
|
private final UsersDetailsRepository userRepo;
|
||||||
|
private final JwtUtil jwtUtil;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public AuthServiceImpl(UserRepository userRepository, OtpClient otpClient, Helper helper,
|
||||||
|
UsersDetailsRepository userRepo, JwtUtil jwtUtil) {
|
||||||
|
this.userRepository = userRepository;
|
||||||
|
this.otpClient = otpClient;
|
||||||
|
this.helper = helper;
|
||||||
|
this.userRepo = userRepo;
|
||||||
|
this.jwtUtil = jwtUtil;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseModel<?> sendOtp(LoginRequest request) {
|
||||||
|
try {
|
||||||
|
OtpSendResponse resp = otpClient.sendOtp(request.getMobile());
|
||||||
|
if (resp == null) {
|
||||||
|
return ResponseModel.builder().message("OTP send service returned null").status("Failure")
|
||||||
|
.statusCode(500).data(null).build();
|
||||||
|
}
|
||||||
|
String status = resp.isSuccess() ? "Success" : "Failure";
|
||||||
|
int code = resp.isSuccess() ? 200 : 400;
|
||||||
|
return ResponseModel.builder().message(resp.getMessage()).status(status).statusCode(code).data(resp)
|
||||||
|
.build();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
LOGGER.error("Error in sendOtp: {}", ex.getMessage(), ex);
|
||||||
|
return ResponseModel.builder().message("An unexpected error occurred while sending OTP").status("Failure")
|
||||||
|
.statusCode(500).data(null).build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseModel<?> verifyOtp(VerifyOtpRequest request) {
|
||||||
|
boolean ok = otpClient.verifyOtp(request.getMobile(), request.getOtp());
|
||||||
|
LOGGER.info("OTP STATUS {}", ok);
|
||||||
|
if (!ok) {
|
||||||
|
return ResponseModel.builder().message("Invalid OTP").status("Failure").statusCode(401).data(null).build();
|
||||||
|
}
|
||||||
|
String mobileNo = request.getMobile();
|
||||||
|
try {
|
||||||
|
Optional<UserEntity> byMobileNumber = userRepository.findByMobile(mobileNo);
|
||||||
|
|
||||||
|
if (byMobileNumber.isPresent()) {
|
||||||
|
UserEntity user = byMobileNumber.get();
|
||||||
|
String token = jwtUtil.generateToken(user.getMobile());
|
||||||
|
|
||||||
|
LOGGER.info("Generated JWT token for mobileNo: " + mobileNo);
|
||||||
|
|
||||||
|
Object userDetailsDTO = null;
|
||||||
|
|
||||||
|
if (user != null) {
|
||||||
|
userDetailsDTO = UserDetailsDTO.builder().id(user.getId()).userEmailId(user.getEmail())
|
||||||
|
.userMobNo(user.getMobile()).userName(user.getName()).userAge(user.getAge()).build();
|
||||||
|
}
|
||||||
|
|
||||||
|
AuthResponses authResp = new AuthResponses(token, "Success", "Login Success", 200, userDetailsDTO);
|
||||||
|
return ResponseModel.builder().message("Login Success").status("Success").statusCode(200).data(authResp)
|
||||||
|
.build();
|
||||||
|
} else {
|
||||||
|
AuthResponses authResp = new AuthResponses("", "User Not Found", "Authentication failed", 401, null);
|
||||||
|
return ResponseModel.builder().message("User Not Found").status("Failure").statusCode(401)
|
||||||
|
.data(authResp).build();
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception ex) {
|
||||||
|
LOGGER.error("Error occurred during login for mobile no: {} Exception: {}", mobileNo, ex.getMessage(), ex);
|
||||||
|
return ResponseModel.builder().message("Authentication failed: " + ex.getMessage()).status("Failure")
|
||||||
|
.statusCode(500).data(null).build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public ResponseModel<?> registerUser(RegisterRequest request) {
|
||||||
|
try {
|
||||||
|
Optional<UserEntity> existing = userRepository.findByMobile(request.getMobile());
|
||||||
|
if (existing.isPresent()) {
|
||||||
|
UserEntity u = existing.get();
|
||||||
|
UserDto dto = new UserDto(u.getId(), u.getMobile(), u.getName(), u.getEmail(), u.getAge());
|
||||||
|
AuthResponse ar = new AuthResponse(false, "User already exists", true, dto);
|
||||||
|
return ResponseModel.builder().message(ar.getMessage()).status("Failure").statusCode(409).data(ar)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
UserEntity newUser = new UserEntity(request.getMobile(), request.getName(), request.getEmail(),
|
||||||
|
request.getAge());
|
||||||
|
userRepository.save(newUser);
|
||||||
|
String token = jwtUtil.generateToken(newUser.getMobile());
|
||||||
|
UserDto dto = new UserDto(newUser.getId(), newUser.getMobile(), newUser.getName(), newUser.getEmail(),
|
||||||
|
newUser.getAge());
|
||||||
|
AuthResponse ar = new AuthResponse(true, "user registed sucessfully", token);
|
||||||
|
return ResponseModel.builder().message(ar.getMessage()).status("Success").statusCode(201).data(ar).build();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
LOGGER.error("Error in registerUser: {}", ex.getMessage(), ex);
|
||||||
|
return ResponseModel.builder().message("An unexpected error occurred while registering user")
|
||||||
|
.status("Failure").statusCode(500).data(null).build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseModel<?> authenticateUser(LoginRequest loginRequest) {
|
||||||
|
LOGGER.info("Processing login for Request: {}", loginRequest);
|
||||||
|
|
||||||
|
try {
|
||||||
|
String mobileNo = loginRequest.getMobile();
|
||||||
|
|
||||||
|
Optional<UsersDetails> byMobileNo = userRepo.findByUserMobNo(mobileNo);
|
||||||
|
|
||||||
|
if (byMobileNo.isPresent()) {
|
||||||
|
UsersDetails user = (UsersDetails) byMobileNo.get();
|
||||||
|
String token = jwtUtil.generateToken(user.getUserMobNo());
|
||||||
|
|
||||||
|
LOGGER.info("Generated JWT token for mobileNo: " + mobileNo);
|
||||||
|
|
||||||
|
Object userDetailsDTO = null;
|
||||||
|
|
||||||
|
if (user != null) {
|
||||||
|
userDetailsDTO = UserDetailsDTO.builder().id(user.getId()).userEmailId(user.getUserEmailId())
|
||||||
|
.userMobNo(user.getUserMobNo()).userName(user.getUserName()).userAge(user.getUserAge())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
AuthResponses authResp = new AuthResponses(token, "Success", "Login Done", 200, userDetailsDTO);
|
||||||
|
return ResponseModel.builder().message("Login Done").status("Success").statusCode(200).data(authResp)
|
||||||
|
.build();
|
||||||
|
} else {
|
||||||
|
AuthResponses authResp = new AuthResponses("", "User Not Found", "Authentication failed", 401, null);
|
||||||
|
return ResponseModel.builder().message("User Not Found").status("Failure").statusCode(401)
|
||||||
|
.data(authResp).build();
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception ex) {
|
||||||
|
LOGGER.error("Error occurred during login for mobile no: {} Exception: {}", loginRequest.getMobile(),
|
||||||
|
ex.getMessage(), ex);
|
||||||
|
return ResponseModel.builder().message("Authentication failed: " + ex.getMessage()).status("Failure")
|
||||||
|
.statusCode(500).data(null).build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UserEntity findByMobile(String mobile) {
|
||||||
|
return userRepository.findByMobile(mobile).orElse(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@ package com.billpaymentservice.bbps.serviceImpl;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -31,10 +32,12 @@ import com.billpaymentservice.bbps.entites.BharatConnectMaster;
|
|||||||
import com.billpaymentservice.bbps.entites.ComplaintStatusOptionsMaster;
|
import com.billpaymentservice.bbps.entites.ComplaintStatusOptionsMaster;
|
||||||
import com.billpaymentservice.bbps.entites.InboundTraceLog;
|
import com.billpaymentservice.bbps.entites.InboundTraceLog;
|
||||||
import com.billpaymentservice.bbps.entites.OutboundTraceLog;
|
import com.billpaymentservice.bbps.entites.OutboundTraceLog;
|
||||||
|
import com.billpaymentservice.bbps.entites.TransactionMaster;
|
||||||
import com.billpaymentservice.bbps.exception.CustomException;
|
import com.billpaymentservice.bbps.exception.CustomException;
|
||||||
import com.billpaymentservice.bbps.repository.BharatConnectMasterRepository;
|
import com.billpaymentservice.bbps.repository.BharatConnectMasterRepository;
|
||||||
import com.billpaymentservice.bbps.repository.ComplainRepository;
|
import com.billpaymentservice.bbps.repository.ComplainRepository;
|
||||||
import com.billpaymentservice.bbps.repository.ComplaintOptionsStatusMasterRepository;
|
import com.billpaymentservice.bbps.repository.ComplaintOptionsStatusMasterRepository;
|
||||||
|
import com.billpaymentservice.bbps.repository.TransactionMasterRepository;
|
||||||
import com.billpaymentservice.bbps.service.ComplainService;
|
import com.billpaymentservice.bbps.service.ComplainService;
|
||||||
import com.billpaymentservice.bbps.util.BBPSConstant;
|
import com.billpaymentservice.bbps.util.BBPSConstant;
|
||||||
import com.billpaymentservice.bbps.util.BillerMapperHelper;
|
import com.billpaymentservice.bbps.util.BillerMapperHelper;
|
||||||
@@ -61,6 +64,7 @@ public class ComplainServiceImpl implements ComplainService {
|
|||||||
private final BillerMapperHelper mapperHelper;
|
private final BillerMapperHelper mapperHelper;
|
||||||
private final ComplainRepository complainRepository;
|
private final ComplainRepository complainRepository;
|
||||||
private final ComplaintOptionsStatusMasterRepository complaintStatusMasterRepository;
|
private final ComplaintOptionsStatusMasterRepository complaintStatusMasterRepository;
|
||||||
|
private final TransactionMasterRepository transactionMasterRepository;
|
||||||
|
|
||||||
// moved to class-level
|
// moved to class-level
|
||||||
private final ObjectMapper objectMapper;
|
private final ObjectMapper objectMapper;
|
||||||
@@ -69,7 +73,8 @@ public class ComplainServiceImpl implements ComplainService {
|
|||||||
public ComplainServiceImpl(RestClient restClient, HttpService httpService, Helper helper,
|
public ComplainServiceImpl(RestClient restClient, HttpService httpService, Helper helper,
|
||||||
BharatConnectMasterRepository beneficiaryDetailsRepository, BillerMapperHelper mapperHelper,
|
BharatConnectMasterRepository beneficiaryDetailsRepository, BillerMapperHelper mapperHelper,
|
||||||
ComplainRepository complainRepository,
|
ComplainRepository complainRepository,
|
||||||
ComplaintOptionsStatusMasterRepository complaintStatusMasterRepository) {
|
ComplaintOptionsStatusMasterRepository complaintStatusMasterRepository,
|
||||||
|
TransactionMasterRepository transactionMasterRepository) {
|
||||||
this.restClient = restClient;
|
this.restClient = restClient;
|
||||||
this.httpService = httpService;
|
this.httpService = httpService;
|
||||||
this.helper = helper;
|
this.helper = helper;
|
||||||
@@ -77,7 +82,7 @@ public class ComplainServiceImpl implements ComplainService {
|
|||||||
this.mapperHelper = mapperHelper;
|
this.mapperHelper = mapperHelper;
|
||||||
this.complainRepository = complainRepository;
|
this.complainRepository = complainRepository;
|
||||||
this.complaintStatusMasterRepository = complaintStatusMasterRepository;
|
this.complaintStatusMasterRepository = complaintStatusMasterRepository;
|
||||||
|
this.transactionMasterRepository = transactionMasterRepository;
|
||||||
// initialize shared ObjectMapper once
|
// initialize shared ObjectMapper once
|
||||||
this.objectMapper = new ObjectMapper();
|
this.objectMapper = new ObjectMapper();
|
||||||
this.objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
this.objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
||||||
@@ -110,10 +115,20 @@ public class ComplainServiceImpl implements ComplainService {
|
|||||||
BBPSConstant.HTTP_POST, null);
|
BBPSConstant.HTTP_POST, null);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
Optional<TransactionMaster> dataById = transactionMasterRepository.findById(complainRequestDTO.getTxnId());
|
||||||
|
if (dataById == null || dataById.isEmpty()) {
|
||||||
|
LOGGER.warn("Txn Id is null");
|
||||||
|
throw new CustomException("Txn Id is required", "FAILED", BBPSConstant.BADREQUEST, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
TransactionMaster transData = dataById.get();
|
||||||
// Inject tenantId + agentId into request JSON
|
// Inject tenantId + agentId into request JSON
|
||||||
ObjectNode root = (ObjectNode) objectMapper.readTree(forwardJson);
|
ObjectNode root = (ObjectNode) objectMapper.readTree(forwardJson);
|
||||||
root.put("tenantId", headersData.getTenantId());
|
root.put("tenantId", headersData.getTenantId());
|
||||||
root.put("agentId", headersData.getAgentId());
|
root.put("agentId", headersData.getAgentId());
|
||||||
|
root.put("billerId", transData.getBillerId());
|
||||||
|
root.put("billerName", transData.getBillerName());
|
||||||
|
|
||||||
String finalJson = root.toString();
|
String finalJson = root.toString();
|
||||||
LOGGER.info("[{}] Final Request Sent to API | reqId={} | payload={}", apiName, requestId, finalJson);
|
LOGGER.info("[{}] Final Request Sent to API | reqId={} | payload={}", apiName, requestId, finalJson);
|
||||||
|
|||||||
@@ -2,28 +2,35 @@ package com.billpaymentservice.bbps.serviceImpl;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.modelmapper.ModelMapper;
|
import org.modelmapper.ModelMapper;
|
||||||
import org.modelmapper.convention.MatchingStrategies;
|
import org.modelmapper.convention.MatchingStrategies;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.billpaymentservice.bbps.config.JwtUtil;
|
||||||
import com.billpaymentservice.bbps.dto.CustomParamDTO;
|
import com.billpaymentservice.bbps.dto.CustomParamDTO;
|
||||||
import com.billpaymentservice.bbps.dto.CustomerParamGroupsDTO;
|
import com.billpaymentservice.bbps.dto.CustomerParamGroupsDTO;
|
||||||
import com.billpaymentservice.bbps.dto.GeneralResp;
|
import com.billpaymentservice.bbps.dto.GeneralResp;
|
||||||
import com.billpaymentservice.bbps.dto.MasterApiResponse;
|
import com.billpaymentservice.bbps.dto.MasterApiResponse;
|
||||||
import com.billpaymentservice.bbps.dto.ResponseModel;
|
import com.billpaymentservice.bbps.dto.ResponseModel;
|
||||||
|
import com.billpaymentservice.bbps.dto.UserDetailsDTO;
|
||||||
import com.billpaymentservice.bbps.dto.request.BillerDetailRequest;
|
import com.billpaymentservice.bbps.dto.request.BillerDetailRequest;
|
||||||
import com.billpaymentservice.bbps.dto.request.ContactMasterRequest;
|
import com.billpaymentservice.bbps.dto.request.ContactMasterRequest;
|
||||||
import com.billpaymentservice.bbps.dto.request.CustomParamRequest;
|
import com.billpaymentservice.bbps.dto.request.CustomParamRequest;
|
||||||
import com.billpaymentservice.bbps.dto.request.DispositionRequest;
|
import com.billpaymentservice.bbps.dto.request.DispositionRequest;
|
||||||
|
import com.billpaymentservice.bbps.dto.request.LoginRequest;
|
||||||
import com.billpaymentservice.bbps.dto.request.MasterCategoryRequest;
|
import com.billpaymentservice.bbps.dto.request.MasterCategoryRequest;
|
||||||
import com.billpaymentservice.bbps.dto.request.MasterRequest;
|
import com.billpaymentservice.bbps.dto.request.MasterRequest;
|
||||||
import com.billpaymentservice.bbps.dto.request.PlanRequest;
|
import com.billpaymentservice.bbps.dto.request.PlanRequest;
|
||||||
import com.billpaymentservice.bbps.dto.response.AmountOptionsResponse;
|
import com.billpaymentservice.bbps.dto.response.AmountOptionsResponse;
|
||||||
|
import com.billpaymentservice.bbps.dto.response.AuthResponses;
|
||||||
import com.billpaymentservice.bbps.dto.response.BillerDataResponse;
|
import com.billpaymentservice.bbps.dto.response.BillerDataResponse;
|
||||||
import com.billpaymentservice.bbps.dto.response.BillerResponse;
|
import com.billpaymentservice.bbps.dto.response.BillerResponse;
|
||||||
import com.billpaymentservice.bbps.dto.response.ChannelsListResponse;
|
import com.billpaymentservice.bbps.dto.response.ChannelsListResponse;
|
||||||
@@ -42,6 +49,7 @@ import com.billpaymentservice.bbps.entites.DispositionDetails;
|
|||||||
import com.billpaymentservice.bbps.entites.InboundTraceLog;
|
import com.billpaymentservice.bbps.entites.InboundTraceLog;
|
||||||
import com.billpaymentservice.bbps.entites.OutboundTraceLog;
|
import com.billpaymentservice.bbps.entites.OutboundTraceLog;
|
||||||
import com.billpaymentservice.bbps.entites.PlanResponses;
|
import com.billpaymentservice.bbps.entites.PlanResponses;
|
||||||
|
import com.billpaymentservice.bbps.entites.UsersDetails;
|
||||||
import com.billpaymentservice.bbps.exception.CustomException;
|
import com.billpaymentservice.bbps.exception.CustomException;
|
||||||
import com.billpaymentservice.bbps.repository.BharatConnectMasterRepository;
|
import com.billpaymentservice.bbps.repository.BharatConnectMasterRepository;
|
||||||
import com.billpaymentservice.bbps.repository.BillerDataRepository;
|
import com.billpaymentservice.bbps.repository.BillerDataRepository;
|
||||||
@@ -50,6 +58,7 @@ import com.billpaymentservice.bbps.repository.DispositionRepository;
|
|||||||
import com.billpaymentservice.bbps.repository.InboundTraceLogRepository;
|
import com.billpaymentservice.bbps.repository.InboundTraceLogRepository;
|
||||||
import com.billpaymentservice.bbps.repository.MerchantRepository;
|
import com.billpaymentservice.bbps.repository.MerchantRepository;
|
||||||
import com.billpaymentservice.bbps.repository.OutboundTraceLogRepository;
|
import com.billpaymentservice.bbps.repository.OutboundTraceLogRepository;
|
||||||
|
import com.billpaymentservice.bbps.repository.UsersDetailsRepository;
|
||||||
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.BillerMapperHelper;
|
import com.billpaymentservice.bbps.util.BillerMapperHelper;
|
||||||
@@ -224,7 +233,7 @@ public class MasterDataServiceImpl implements MasterDataService {
|
|||||||
throw new CustomException("Invalid JSON received from API");
|
throw new CustomException("Invalid JSON received from API");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResponseModel getCustomerParamByBillerId(CustomParamRequest customerParamRequest) {
|
public ResponseModel getCustomerParamByBillerId(CustomParamRequest customerParamRequest) {
|
||||||
String apiName = BBPSConstant.API_GET_CUSTOMER_PARAM_BY_BILLER_ID;
|
String apiName = BBPSConstant.API_GET_CUSTOMER_PARAM_BY_BILLER_ID;
|
||||||
@@ -366,7 +375,7 @@ public class MasterDataServiceImpl implements MasterDataService {
|
|||||||
LOGGER.info("[{}] START | reqId={} | mid={} | billerName={} | category={}", apiName, requestId, mid,
|
LOGGER.info("[{}] START | reqId={} | mid={} | billerName={} | category={}", apiName, requestId, mid,
|
||||||
masterRequest.getBillerName(), masterRequest.getCategory());
|
masterRequest.getBillerName(), masterRequest.getCategory());
|
||||||
|
|
||||||
String txnID = helper.generateTxnId(15);
|
String txnID = helper.generateTxnId(15);
|
||||||
String fullUrl = String.format("%s%s?billerName=%s&category=%s&page=%d&pagesize=%d", masterRegisterUrl,
|
String fullUrl = String.format("%s%s?billerName=%s&category=%s&page=%d&pagesize=%d", masterRegisterUrl,
|
||||||
BBPSConstant.BILLER_URL, masterRequest.getBillerName(), masterRequest.getCategory(),
|
BBPSConstant.BILLER_URL, masterRequest.getBillerName(), masterRequest.getCategory(),
|
||||||
masterRequest.getPageNo(), masterRequest.getPageSize());
|
masterRequest.getPageNo(), masterRequest.getPageSize());
|
||||||
@@ -472,7 +481,7 @@ public class MasterDataServiceImpl implements MasterDataService {
|
|||||||
if (entities != null) {
|
if (entities != null) {
|
||||||
dispositionRepository.saveAll(entities);
|
dispositionRepository.saveAll(entities);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
LOGGER.warn("No disposition found in response to save.");
|
LOGGER.warn("No disposition found in response to save.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -142,6 +142,8 @@ public class PaymentServiceImpl implements PaymentService {
|
|||||||
PaymentInitiate paymentInitiate = new PaymentInitiate();
|
PaymentInitiate paymentInitiate = new PaymentInitiate();
|
||||||
paymentInitiate.setTxnId(txnId);
|
paymentInitiate.setTxnId(txnId);
|
||||||
paymentInitiate.setReqId(requestId);
|
paymentInitiate.setReqId(requestId);
|
||||||
|
paymentInitiate.setMid(billPaymentRequest.getMid());
|
||||||
|
paymentInitiate.setClientUserId(billPaymentRequest.getClientUserId());
|
||||||
paymentInitiate.setBankTxnId(billPaymentResponse.getTxnId());
|
paymentInitiate.setBankTxnId(billPaymentResponse.getTxnId());
|
||||||
paymentInitiate.setStatus(billPaymentResponse.getStatus());
|
paymentInitiate.setStatus(billPaymentResponse.getStatus());
|
||||||
paymentIntiateRepository.save(paymentInitiate);
|
paymentIntiateRepository.save(paymentInitiate);
|
||||||
@@ -150,6 +152,9 @@ public class PaymentServiceImpl implements PaymentService {
|
|||||||
TransactionStatusRequest transactionStatusRequest = new TransactionStatusRequest();
|
TransactionStatusRequest transactionStatusRequest = new TransactionStatusRequest();
|
||||||
transactionStatusRequest.setTxnId(billPaymentResponse.getTxnId());
|
transactionStatusRequest.setTxnId(billPaymentResponse.getTxnId());
|
||||||
transactionStatusRequest.setReqId(requestId);
|
transactionStatusRequest.setReqId(requestId);
|
||||||
|
transactionStatusRequest.setMid(billPaymentRequest.getMid());
|
||||||
|
transactionStatusRequest.setClientUserId(billPaymentRequest.getClientUserId());
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Thread.sleep((long) BBPSConstant.PAYMENT_STATUS_DELAY_MS);
|
Thread.sleep((long) BBPSConstant.PAYMENT_STATUS_DELAY_MS);
|
||||||
@@ -213,6 +218,8 @@ public class PaymentServiceImpl implements PaymentService {
|
|||||||
TransactionMaster transactionMaster = modelMapper.map(responseWrapper.getTransactionDAO(), TransactionMaster.class);
|
TransactionMaster transactionMaster = modelMapper.map(responseWrapper.getTransactionDAO(), TransactionMaster.class);
|
||||||
transactionMaster.setTxnId(txnId);
|
transactionMaster.setTxnId(txnId);
|
||||||
transactionMaster.setReqId(transactionStatusRequest.getReqId());
|
transactionMaster.setReqId(transactionStatusRequest.getReqId());
|
||||||
|
transactionMaster.setMid(transactionStatusRequest.getMid());
|
||||||
|
transactionMaster.setClientUserId(transactionStatusRequest.getClientUserId());
|
||||||
EntityRelationshipUtil.linkTransactionMasterRelationships(transactionMaster);
|
EntityRelationshipUtil.linkTransactionMasterRelationships(transactionMaster);
|
||||||
transactionMasterRepository.save(transactionMaster);
|
transactionMasterRepository.save(transactionMaster);
|
||||||
LOGGER.info("TransactionMaster saved successfully for txnId={}", txnId);
|
LOGGER.info("TransactionMaster saved successfully for txnId={}", txnId);
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import org.springframework.context.annotation.Configuration;
|
|||||||
import io.swagger.v3.oas.models.OpenAPI;
|
import io.swagger.v3.oas.models.OpenAPI;
|
||||||
import io.swagger.v3.oas.models.info.Contact;
|
import io.swagger.v3.oas.models.info.Contact;
|
||||||
import io.swagger.v3.oas.models.info.Info;
|
import io.swagger.v3.oas.models.info.Info;
|
||||||
|
import io.swagger.v3.oas.models.security.SecurityRequirement;
|
||||||
|
import io.swagger.v3.oas.models.security.SecurityScheme;
|
||||||
import io.swagger.v3.oas.models.servers.Server;
|
import io.swagger.v3.oas.models.servers.Server;
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@@ -21,12 +23,15 @@ public class SwaggerConfig {
|
|||||||
private String serverDescription;
|
private String serverDescription;
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public OpenAPI openAPI() {
|
public OpenAPI customOpenAPI() {
|
||||||
return new OpenAPI()
|
return new OpenAPI().addSecurityItem(new SecurityRequirement().addList("Authentication"))
|
||||||
.info(new Info().title("BBPS API").description("Spring Boot REST API for BBPS System API Documentation")
|
.components(new io.swagger.v3.oas.models.Components().addSecuritySchemes("Authentication",
|
||||||
.version("1.0.0").contact(new Contact().name("BBPS ")))
|
new SecurityScheme().name("Authentication").type(SecurityScheme.Type.APIKEY)
|
||||||
|
.in(SecurityScheme.In.HEADER)))
|
||||||
|
.info(new Info().title("Spring Boot REST API").description("Spring Boot REST API for BBPS Project")
|
||||||
|
.version("1.0.0").contact(new Contact().email("info@merchantpanel.com")))
|
||||||
.servers(List.of(new Server().url(serverUrl).description(serverDescription)));
|
.servers(List.of(new Server().url(serverUrl).description(serverDescription)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,10 @@ package com.billpaymentservice.bbps.util;
|
|||||||
|
|
||||||
public class BBPSConstant {
|
public class BBPSConstant {
|
||||||
|
|
||||||
|
// Jwt Token Expiration Time
|
||||||
|
public static final long JWT_EXPIRATION_MS = 1000 * 60 * 60 * 24; // 24 hours
|
||||||
|
public static final long REFRESH_EXPIRATION_MS = 1000L * 60 * 60 * 24 * 7; // 7 days
|
||||||
|
|
||||||
public static final Long SENT_TO_PROCESSOR_CODE = 198L;
|
public static final Long SENT_TO_PROCESSOR_CODE = 198L;
|
||||||
public static final Long SUCCESS_CODE = 200L;
|
public static final Long SUCCESS_CODE = 200L;
|
||||||
public static final Long FAILED_CODE = 99L;
|
public static final Long FAILED_CODE = 99L;
|
||||||
|
|||||||
@@ -1044,9 +1044,6 @@ public class BillerMapperHelper {
|
|||||||
|
|
||||||
public FetchComplaintForwardRequest fetchComplaintForwardRequestMap(ComplaintRequestDTO complainRequestDTO) {
|
public FetchComplaintForwardRequest fetchComplaintForwardRequestMap(ComplaintRequestDTO complainRequestDTO) {
|
||||||
FetchComplaintForwardRequest forward = new FetchComplaintForwardRequest();
|
FetchComplaintForwardRequest forward = new FetchComplaintForwardRequest();
|
||||||
|
|
||||||
forward.setBillerId(complainRequestDTO.getBillerId());
|
|
||||||
forward.setBillerName(complainRequestDTO.getBillerName());
|
|
||||||
forward.setTicketDescription(complainRequestDTO.getTicketDescription());
|
forward.setTicketDescription(complainRequestDTO.getTicketDescription());
|
||||||
forward.setTicketDisposition(complainRequestDTO.getTicketDisposition());
|
forward.setTicketDisposition(complainRequestDTO.getTicketDisposition());
|
||||||
forward.setTicketDispositionCode(complainRequestDTO.getTicketDispositionCode());
|
forward.setTicketDispositionCode(complainRequestDTO.getTicketDispositionCode());
|
||||||
|
|||||||
@@ -8,9 +8,11 @@ import org.springframework.http.HttpHeaders;
|
|||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import com.billpaymentservice.bbps.dto.auth.RegisterRequest;
|
||||||
import com.billpaymentservice.bbps.entites.BBPSMastersData;
|
import com.billpaymentservice.bbps.entites.BBPSMastersData;
|
||||||
import com.billpaymentservice.bbps.entites.InboundTraceLog;
|
import com.billpaymentservice.bbps.entites.InboundTraceLog;
|
||||||
import com.billpaymentservice.bbps.entites.OutboundTraceLog;
|
import com.billpaymentservice.bbps.entites.OutboundTraceLog;
|
||||||
|
import com.billpaymentservice.bbps.entites.UserEntity;
|
||||||
import com.billpaymentservice.bbps.entites.BharatConnectMaster;
|
import com.billpaymentservice.bbps.entites.BharatConnectMaster;
|
||||||
import com.billpaymentservice.bbps.exception.CustomException;
|
import com.billpaymentservice.bbps.exception.CustomException;
|
||||||
import com.billpaymentservice.bbps.repository.BBPSMasterDataRepo;
|
import com.billpaymentservice.bbps.repository.BBPSMasterDataRepo;
|
||||||
@@ -166,4 +168,14 @@ public class Helper {
|
|||||||
return headers;
|
return headers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public UserEntity createNewUser(RegisterRequest request) {
|
||||||
|
UserEntity user = new UserEntity();
|
||||||
|
|
||||||
|
user.setMobile(request.getMobile());
|
||||||
|
user.setName(request.getName());
|
||||||
|
user.setEmail(request.getEmail());
|
||||||
|
user.setAge(request.getAge());
|
||||||
|
return user;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,173 @@
|
|||||||
|
package com.billpaymentservice.bbps.util;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.http.HttpEntity;
|
||||||
|
import org.springframework.http.HttpHeaders;
|
||||||
|
import org.springframework.http.HttpMethod;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
|
import com.billpaymentservice.bbps.dto.auth.OtpSendResponse;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class OtpClient {
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(OtpClient.class);
|
||||||
|
|
||||||
|
private final RestTemplate restTemplate = new RestTemplate();
|
||||||
|
|
||||||
|
@Value("${ekyc.mobile}")
|
||||||
|
private String sendUrl;
|
||||||
|
|
||||||
|
@Value("${ekyc.mobile.verify.otp}")
|
||||||
|
private String verifyUrl;
|
||||||
|
|
||||||
|
// New config properties for eKYC-style OTP API
|
||||||
|
@Value("${ekyc.mobile}")
|
||||||
|
private String ekycMobileUrl;
|
||||||
|
|
||||||
|
@Value("${ekyc.apikey}")
|
||||||
|
private String apiKey;
|
||||||
|
|
||||||
|
@Value("${ekyc.secreteKey}")
|
||||||
|
private String secretKey;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calls external API to send OTP. The implementation assumes a POST with JSON {"mobile":"..."}
|
||||||
|
* Modify headers/body as per your external API. Updated to support eKYC OTP generation logic.
|
||||||
|
*/
|
||||||
|
public OtpSendResponse sendOtp(String mobile) {
|
||||||
|
try {
|
||||||
|
logger.info("Initiating OTP send process for mobile: {}", mobile);
|
||||||
|
|
||||||
|
// If explicit eKYC config present, use that flow
|
||||||
|
if (ekycMobileUrl != null && !ekycMobileUrl.isEmpty()) {
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||||
|
|
||||||
|
// Build JSON body string as in user's snippet
|
||||||
|
String jsonBody = "{\"mobileNumber\":\"" + mobile + "\", \"apiKey\":\"" + apiKey
|
||||||
|
+ "\", \"secretKey\":\"" + secretKey + "\"}";
|
||||||
|
|
||||||
|
HttpEntity<String> request = new HttpEntity<>(jsonBody, headers);
|
||||||
|
|
||||||
|
try {
|
||||||
|
ResponseEntity<String> response = restTemplate.exchange(ekycMobileUrl, HttpMethod.POST, request,
|
||||||
|
String.class);
|
||||||
|
logger.info("eKYC OTP generation API response status: {}", response.getStatusCode());
|
||||||
|
|
||||||
|
if (response.getStatusCode() == HttpStatus.OK) {
|
||||||
|
logger.info("OTP generated successfully for mobile: {}", mobile);
|
||||||
|
return new OtpSendResponse(true, "OTP generated successfully");
|
||||||
|
|
||||||
|
} else {
|
||||||
|
logger.error("Failed to call eKYC OTP generation API: {}", response.getStatusCode());
|
||||||
|
return new OtpSendResponse(false, "Failed to call OTP generation service");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("Error calling eKYC OTP generation API: {}", e.getMessage(), e);
|
||||||
|
return new OtpSendResponse(false, "Error while generating OTP: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fallback to previously configured generic sendUrl behavior
|
||||||
|
if (sendUrl == null || sendUrl.isEmpty()) {
|
||||||
|
return new OtpSendResponse(true, "(stub) OTP sent to " + mobile);
|
||||||
|
}
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||||
|
Map<String, String> body = new HashMap<>();
|
||||||
|
body.put("mobile", mobile);
|
||||||
|
HttpEntity<Map<String, String>> req = new HttpEntity<>(body, headers);
|
||||||
|
// expecting external API returns {"success":true,"message":"..."}
|
||||||
|
Map resp = restTemplate.postForObject(sendUrl, req, Map.class);
|
||||||
|
boolean success = resp != null && Boolean.TRUE.equals(resp.get("success"));
|
||||||
|
String message = resp == null ? "no response" : String.valueOf(resp.get("message"));
|
||||||
|
return new OtpSendResponse(success, message);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("Unexpected error in sendOtp: {}", e.getMessage(), e);
|
||||||
|
return new OtpSendResponse(false, "Failed to call OTP send: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calls external API to verify OTP. Returns true if OTP valid.
|
||||||
|
*/
|
||||||
|
public boolean verifyOtp(String mobile, String otp) {
|
||||||
|
try {
|
||||||
|
// basic input validation
|
||||||
|
if (mobile == null || mobile.isEmpty() || otp == null || otp.isEmpty()) {
|
||||||
|
logger.debug("verifyOtp called with empty mobile or otp");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.info("Verifying Mobile OTP for mobile: {}", mobile);
|
||||||
|
|
||||||
|
// If an eKYC verify endpoint is configured, use it
|
||||||
|
if (verifyUrl != null && !verifyUrl.isEmpty()) {
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||||
|
headers.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON));
|
||||||
|
|
||||||
|
Map<String, String> requestBody = new HashMap<>();
|
||||||
|
requestBody.put("mobileNumber", mobile);
|
||||||
|
requestBody.put("apiKey", apiKey);
|
||||||
|
requestBody.put("secretKey", secretKey);
|
||||||
|
requestBody.put("otp", otp);
|
||||||
|
|
||||||
|
HttpEntity<Map<String, String>> requestEntity = new HttpEntity<>(requestBody, headers);
|
||||||
|
try {
|
||||||
|
ResponseEntity<String> response = restTemplate.exchange(verifyUrl, HttpMethod.POST,
|
||||||
|
requestEntity, String.class);
|
||||||
|
|
||||||
|
logger.info("Mobile OTP verification API response: status={}, body={}", response.getStatusCode(),
|
||||||
|
response.getBody());
|
||||||
|
|
||||||
|
if (response.getStatusCode() == HttpStatus.OK) {
|
||||||
|
String respBody = response.getBody();
|
||||||
|
|
||||||
|
if (respBody != null) {
|
||||||
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
|
Map respMap = mapper.readValue(respBody, Map.class);
|
||||||
|
|
||||||
|
// Check correct key of your service
|
||||||
|
if (respMap.containsKey("status")) {
|
||||||
|
return Boolean.TRUE.equals(respMap.get("status"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false; // default fallback
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
logger.warn("OTP verification endpoint returned non-OK status: {}", response.getStatusCode());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("Error calling eKYC OTP verify API: {}", e.getMessage(), e);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// stub behaviour when no verify URL configured: accept OTP "123456"
|
||||||
|
return false;
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("Unexpected error in verifyOtp: {}", e.getMessage(), e);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -20,12 +20,20 @@ swagger.server.description=Local Development Server
|
|||||||
# DataSource
|
# DataSource
|
||||||
spring.datasource.url=jdbc:postgresql://localhost:5432/BBPS
|
spring.datasource.url=jdbc:postgresql://localhost:5432/BBPS
|
||||||
spring.datasource.username=postgres
|
spring.datasource.username=postgres
|
||||||
spring.datasource.password=UAT@DB_2025
|
#spring.datasource.password=UAT@DB_2025
|
||||||
|
|
||||||
#spring.datasource.password=himanshu@123
|
spring.datasource.password=himanshu@123
|
||||||
spring.datasource.driver-class-name=org.postgresql.Driver
|
spring.datasource.driver-class-name=org.postgresql.Driver
|
||||||
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
|
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
|
||||||
|
|
||||||
|
ekyc.apikey=key_live_823fb2b5ba984ea293b6695331f83788
|
||||||
|
ekyc.secreteKey= secret_live_b2acae6e1fd54d6faa148b08af8ae098
|
||||||
|
ekyc.mobile=https://ekyc.lincpay.in/EKYC/ekyc/mobile/generate-otp
|
||||||
|
ekyc.mobile.verify.otp=https://ekyc.lincpay.in/EKYC/ekyc/verify-mobile-otp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
enc.key=lincpay
|
||||||
|
|
||||||
# HikariCP settings
|
# HikariCP settings
|
||||||
spring.datasource.hikari.connection-timeout=10000
|
spring.datasource.hikari.connection-timeout=10000
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ swagger.server.description=Local Development Server
|
|||||||
spring.profiles.active=local
|
spring.profiles.active=local
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# DataSource
|
# DataSource
|
||||||
spring.datasource.url=jdbc:postgresql://localhost:5432/BBPS
|
spring.datasource.url=jdbc:postgresql://localhost:5432/BBPS
|
||||||
spring.datasource.username=postgres
|
spring.datasource.username=postgres
|
||||||
@@ -44,7 +45,14 @@ logging.level.io.github.resilience4j.retry=DEBUG
|
|||||||
master.data.url = https://bbps-staging.digiledge.in/agent/cou-master/masters
|
master.data.url = https://bbps-staging.digiledge.in/agent/cou-master/masters
|
||||||
agent.data.url=https://bbps-staging.digiledge.in/agent/bill-payment-new
|
agent.data.url=https://bbps-staging.digiledge.in/agent/bill-payment-new
|
||||||
payment.data.url=https://bbps-staging.digiledge.in/couapp
|
payment.data.url=https://bbps-staging.digiledge.in/couapp
|
||||||
complaint.data.url=https://bbps-staging.digiledge.in
|
complaint.data.url=https://bbps-staging.digiledge.in/agent/bill-payment-new
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ekyc.apikey=key_live_823fb2b5ba984ea293b6695331f83788
|
||||||
|
ekyc.secreteKey= secret_live_b2acae6e1fd54d6faa148b08af8ae098
|
||||||
|
ekyc.mobile=https://ekyc.lincpay.in/EKYC/ekyc/mobile/generate-otp
|
||||||
|
ekyc.mobile.verify.otp=https://ekyc.lincpay.in/EKYC/ekyc/verify-mobile-otp
|
||||||
|
|
||||||
# throw NoHandlerFoundException for 404s
|
# throw NoHandlerFoundException for 404s
|
||||||
spring.mvc.throw-exception-if-no-handler-found=true
|
spring.mvc.throw-exception-if-no-handler-found=true
|
||||||
@@ -55,6 +63,9 @@ spring.web.resources.add-mappings=false
|
|||||||
# (optional) to avoid path match issues on Spring Boot 2.6+
|
# (optional) to avoid path match issues on Spring Boot 2.6+
|
||||||
spring.mvc.pathmatch.matching-strategy=ANT_PATH_MATCHER
|
spring.mvc.pathmatch.matching-strategy=ANT_PATH_MATCHER
|
||||||
|
|
||||||
|
jwt.secret=6C756148487475787A414646736D4B6E444E585A766145396E6A4555594A595566657A6E434D62536856674A704C494F6C6E666B366A4A6A6D5630323564716C614F
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Resilience4j Retry
|
# Resilience4j Retry
|
||||||
resilience4j.retry.instances.callbackService.max-attempts=1
|
resilience4j.retry.instances.callbackService.max-attempts=1
|
||||||
|
|||||||
Reference in New Issue
Block a user