removed @IgnoreJson from bankId
This commit is contained in:
@@ -19,11 +19,14 @@ public class IpksAccountRequest {
|
||||
@JsonAlias({"cif","custNum","cust_num"})
|
||||
private String cif;
|
||||
|
||||
@JsonIgnore
|
||||
|
||||
@NotBlank(message = "bankId must not be blank")
|
||||
@JsonProperty("bankId")
|
||||
private String bankId;
|
||||
|
||||
|
||||
|
||||
|
||||
// getters/setters
|
||||
public String getCif() { return cif; }
|
||||
public void setCif(String cif) { this.cif = cif; }
|
||||
|
||||
@@ -134,7 +134,9 @@ public class IpksCustomerRequest {
|
||||
@JsonAlias({"relative_name"})
|
||||
private String relativeName;
|
||||
|
||||
@JsonIgnore
|
||||
|
||||
@NotBlank(message = "bankId must not be blank")
|
||||
@JsonProperty("bankId")
|
||||
private String bankId;
|
||||
|
||||
|
||||
@@ -142,6 +144,7 @@ public class IpksCustomerRequest {
|
||||
|
||||
|
||||
|
||||
|
||||
// ===== Getters & Setters (camelCase) =====
|
||||
|
||||
public String getFirstName() {
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user