From daa746fb60b6e8cda6dc0de129d36e2c50810295 Mon Sep 17 00:00:00 2001 From: Bishwajeet Kumar Rajak Date: Wed, 17 Jun 2026 22:25:40 +0530 Subject: [PATCH] removed @IgnoreJson from bankId --- .../com/main/ipks/dto/account/IpksAccountRequest.java | 5 ++++- .../java/com/main/ipks/dto/cif/IpksCustomerRequest.java | 5 ++++- .../java/com/main/ipks/service/CbsIntegrationService.java | 1 + src/main/java/com/main/ipks/service/TokenService.java | 8 ++++++++ 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/main/ipks/dto/account/IpksAccountRequest.java b/src/main/java/com/main/ipks/dto/account/IpksAccountRequest.java index 638f414..93ce236 100644 --- a/src/main/java/com/main/ipks/dto/account/IpksAccountRequest.java +++ b/src/main/java/com/main/ipks/dto/account/IpksAccountRequest.java @@ -19,8 +19,11 @@ public class IpksAccountRequest { @JsonAlias({"cif","custNum","cust_num"}) private String cif; - @JsonIgnore + + @NotBlank(message = "bankId must not be blank") + @JsonProperty("bankId") private String bankId; + diff --git a/src/main/java/com/main/ipks/dto/cif/IpksCustomerRequest.java b/src/main/java/com/main/ipks/dto/cif/IpksCustomerRequest.java index 7db98e8..f6bddb9 100644 --- a/src/main/java/com/main/ipks/dto/cif/IpksCustomerRequest.java +++ b/src/main/java/com/main/ipks/dto/cif/IpksCustomerRequest.java @@ -134,8 +134,11 @@ public class IpksCustomerRequest { @JsonAlias({"relative_name"}) private String relativeName; - @JsonIgnore + + @NotBlank(message = "bankId must not be blank") + @JsonProperty("bankId") private String bankId; + diff --git a/src/main/java/com/main/ipks/service/CbsIntegrationService.java b/src/main/java/com/main/ipks/service/CbsIntegrationService.java index 92a83ed..602db79 100644 --- a/src/main/java/com/main/ipks/service/CbsIntegrationService.java +++ b/src/main/java/com/main/ipks/service/CbsIntegrationService.java @@ -113,6 +113,7 @@ public class CbsIntegrationService { // ---------------- Account Creation (API-1 + API-2) ---------------- public AccountCreationResponse createAccount(IpksAccountRequest reqDto) { try { + log.info("BANK-ID- {}",reqDto.getBankId()); String token = tokenService.getToken(reqDto.getBankId()); HttpHeaders headers = buildHeaders(token); diff --git a/src/main/java/com/main/ipks/service/TokenService.java b/src/main/java/com/main/ipks/service/TokenService.java index cf6e990..4ee90e6 100644 --- a/src/main/java/com/main/ipks/service/TokenService.java +++ b/src/main/java/com/main/ipks/service/TokenService.java @@ -36,6 +36,12 @@ public class TokenService { } public String getToken(String bankId) { + + if (bankId == null || bankId.isBlank()) { + log.error("Invalid bankId received: {}", bankId); + } + + long now = System.currentTimeMillis(); String cachedToken = tokenCache.get(bankId); Long expiry = expiryCache.get(bankId); @@ -56,6 +62,8 @@ public class TokenService { String url = tokenUrl + "/" + bankId; + log.info("Token fetching for bank {}. url={}", bankId, url); + // Only 2 attempts total for (int attempt = 1; attempt <= 2; attempt++) { try {