updated code
This commit is contained in:
@@ -11,9 +11,7 @@ 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 {
|
||||
|
||||
@@ -32,7 +32,7 @@ public class BillPaymentRequest extends BaseClass {
|
||||
|
||||
private String customerMobNo;
|
||||
|
||||
private String txnAmount; // Changed to @NotNull as it's an Integer (non-nullable)
|
||||
private Integer txnAmount; // Changed to @NotNull as it's an Integer (non-nullable)
|
||||
|
||||
private String paymentRefId;
|
||||
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ public class BillPaymentForwardRequest {
|
||||
private String billerCategory;
|
||||
private String macAdress;
|
||||
private String customerMobNo;
|
||||
private String txnAmount;
|
||||
private Integer txnAmount;
|
||||
private String paymentRefId;
|
||||
private String clientReqId;
|
||||
private String paymentChannel;
|
||||
|
||||
@@ -14,7 +14,7 @@ import lombok.Setter;
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "bbps_bill_customer_params")
|
||||
public class BillCustomerParams {
|
||||
public class BillCustomerParams extends Auditable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
|
||||
@@ -14,52 +14,55 @@ import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
@Entity
|
||||
@Table(name="bbps_inbound_log_trace")
|
||||
@Getter @Setter @NoArgsConstructor @ToString
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@ToString
|
||||
@Table(name = "bbps_inbound_trace_log")
|
||||
public class InboundTraceLog {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
// 🔹 Identifiers
|
||||
@Column(length = 50, unique = true)
|
||||
private String requestId; // external requestId (from client)
|
||||
@Column(length = 35)
|
||||
private String txnId; // internally generated transaction id
|
||||
// 🔹 Identifiers
|
||||
@Column(length = 50, unique = true)
|
||||
private String requestId; // external requestId (from client)
|
||||
@Column(length = 35)
|
||||
private String txnId; // internally generated transaction id
|
||||
|
||||
// 🔹 Source & API info
|
||||
private String orgId; // tumhara org code (like ORG001)
|
||||
private String mid; // merchant id from request
|
||||
private String apiName; // e.g. getBillerByBillerId
|
||||
private String httpMethod; // GET / POST
|
||||
// 🔹 Source & API info
|
||||
private String orgId; // tumhara org code (like ORG001)
|
||||
private String mid; // merchant id from request
|
||||
private String apiName; // e.g. getBillerByBillerId
|
||||
private String httpMethod; // GET / POST
|
||||
|
||||
// 🔹 Request/Response data
|
||||
@Column(columnDefinition = "TEXT")
|
||||
private String requestPayload; // jo external ne bheja
|
||||
@Column(columnDefinition = "TEXT")
|
||||
private String responsePayload; // jo tumne wapas bheja
|
||||
// 🔹 Request/Response data
|
||||
@Column(columnDefinition = "TEXT")
|
||||
private String requestPayload; // jo external ne bheja
|
||||
@Column(columnDefinition = "TEXT")
|
||||
private String responsePayload; // jo tumne wapas bheja
|
||||
|
||||
// 🔹 Status & timing
|
||||
private String status; // SUCCESS / FAILED
|
||||
private String responseCode; // like 200, 400 etc.
|
||||
private LocalDateTime requestTime; // jab request aayi
|
||||
private LocalDateTime responseTime; // jab response gaya
|
||||
private LocalDateTime createdAt = LocalDateTime.now();
|
||||
// 🔹 Status & timing
|
||||
private String status; // SUCCESS / FAILED
|
||||
private String responseCode; // like 200, 400 etc.
|
||||
private LocalDateTime requestTime; // jab request aayi
|
||||
private LocalDateTime responseTime; // jab response gaya
|
||||
private LocalDateTime createdAt = LocalDateTime.now();
|
||||
|
||||
@Column(length = 255)
|
||||
private String remark; // error ya note
|
||||
|
||||
public InboundTraceLog(String requestId, String txnId, String apiName, String mid,
|
||||
String orgId, String httpMethod, String requestPayload) {
|
||||
this.requestId = requestId;
|
||||
this.txnId = txnId;
|
||||
this.apiName = apiName;
|
||||
this.mid = mid;
|
||||
this.orgId = orgId;
|
||||
this.httpMethod = httpMethod;
|
||||
this.requestPayload = requestPayload;
|
||||
this.requestTime = LocalDateTime.now();
|
||||
this.createdAt = LocalDateTime.now();
|
||||
}
|
||||
@Column(length = 255)
|
||||
private String remark; // error ya note
|
||||
|
||||
public InboundTraceLog(String requestId, String txnId, String apiName, String mid, String orgId, String httpMethod,
|
||||
String requestPayload) {
|
||||
this.requestId = requestId;
|
||||
this.txnId = txnId;
|
||||
this.apiName = apiName;
|
||||
this.mid = mid;
|
||||
this.orgId = orgId;
|
||||
this.httpMethod = httpMethod;
|
||||
this.requestPayload = requestPayload;
|
||||
this.requestTime = LocalDateTime.now();
|
||||
this.createdAt = LocalDateTime.now();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,11 +14,11 @@ import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
@Entity
|
||||
@Table(name = "bbps_outbound_log_trace")
|
||||
@ToString
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@ToString
|
||||
@Table(name = "bbps_outbound_trace_log")
|
||||
public class OutboundTraceLog {
|
||||
|
||||
@Id
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
package com.billpaymentservice.bbps.entites;
|
||||
|
||||
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 = "bbps_user_details")
|
||||
|
||||
public class UsersDetails extends Auditable {
|
||||
|
||||
@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;
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
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);
|
||||
|
||||
}
|
||||
@@ -20,10 +20,8 @@ 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.exception.CustomException;
|
||||
import com.billpaymentservice.bbps.repository.UserRepository;
|
||||
import com.billpaymentservice.bbps.repository.UsersDetailsRepository;
|
||||
import com.billpaymentservice.bbps.service.AuthService;
|
||||
import com.billpaymentservice.bbps.util.BBPSConstant;
|
||||
import com.billpaymentservice.bbps.util.Helper;
|
||||
@@ -41,16 +39,13 @@ public class AuthServiceImpl implements AuthService {
|
||||
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) {
|
||||
public AuthServiceImpl(UserRepository userRepository, OtpClient otpClient, Helper helper, JwtUtil jwtUtil) {
|
||||
this.userRepository = userRepository;
|
||||
this.otpClient = otpClient;
|
||||
this.helper = helper;
|
||||
this.userRepo = userRepo;
|
||||
this.jwtUtil = jwtUtil;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,6 @@ import com.billpaymentservice.bbps.entites.DispositionDetails;
|
||||
import com.billpaymentservice.bbps.entites.InboundTraceLog;
|
||||
import com.billpaymentservice.bbps.entites.OutboundTraceLog;
|
||||
import com.billpaymentservice.bbps.entites.PlanResponses;
|
||||
import com.billpaymentservice.bbps.entites.UsersDetails;
|
||||
import com.billpaymentservice.bbps.exception.CustomException;
|
||||
import com.billpaymentservice.bbps.repository.BharatConnectMasterRepository;
|
||||
import com.billpaymentservice.bbps.repository.BillerDataRepository;
|
||||
@@ -58,7 +57,6 @@ import com.billpaymentservice.bbps.repository.DispositionRepository;
|
||||
import com.billpaymentservice.bbps.repository.InboundTraceLogRepository;
|
||||
import com.billpaymentservice.bbps.repository.MerchantRepository;
|
||||
import com.billpaymentservice.bbps.repository.OutboundTraceLogRepository;
|
||||
import com.billpaymentservice.bbps.repository.UsersDetailsRepository;
|
||||
import com.billpaymentservice.bbps.service.MasterDataService;
|
||||
import com.billpaymentservice.bbps.util.BBPSConstant;
|
||||
import com.billpaymentservice.bbps.util.BillerMapperHelper;
|
||||
|
||||
@@ -138,9 +138,15 @@ public class PaymentServiceImpl implements PaymentService {
|
||||
LOGGER.warn("Invalid response structure received for txnId={}", txnId);
|
||||
throw new CustomException(BBPSConstant.INVALID_STRUCTURE);
|
||||
}
|
||||
|
||||
BillPaymentResponse billPaymentResponse = objectMapper.convertValue(dataMap, BillPaymentResponse.class);
|
||||
|
||||
GeneralResp generalResponse = billPaymentResponse.getGenericResponse();
|
||||
LOGGER.info("genric Response" + generalResponse);
|
||||
if(generalResponse.getStatus().equalsIgnoreCase("Failed")) {
|
||||
throw new CustomException(generalResponse.getMessage(), generalResponse.getStatus(),
|
||||
Integer.parseInt(generalResponse.getStatusCode()), generalResponse.getRemarks());
|
||||
}
|
||||
|
||||
|
||||
BillPayment entity = modelMapper.map(billPaymentResponse, BillPayment.class);
|
||||
paymentRepository.save(entity);
|
||||
|
||||
@@ -303,7 +303,7 @@ public class PaymentStartServiceImpl implements PaymentStartService {
|
||||
rd.setAmount(parsedAmount != null && !parsedAmount.isEmpty() ? parsedAmount : "0.00");
|
||||
rd.setMid(parsedMid);
|
||||
rd.setOrderNo(orderNo);
|
||||
rd.setQrString("NO_QR");
|
||||
rd.setQrString("HTML_RESPONSE");
|
||||
rd.setCreatedOn(LocalDateTime.now().toString());
|
||||
|
||||
apiResp.setResponseData(rd);
|
||||
|
||||
Reference in New Issue
Block a user