removed @IgnoreJson from bankId
This commit is contained in:
@@ -19,11 +19,14 @@ public class IpksAccountRequest {
|
|||||||
@JsonAlias({"cif","custNum","cust_num"})
|
@JsonAlias({"cif","custNum","cust_num"})
|
||||||
private String cif;
|
private String cif;
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
|
@NotBlank(message = "bankId must not be blank")
|
||||||
|
@JsonProperty("bankId")
|
||||||
private String bankId;
|
private String bankId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// getters/setters
|
// getters/setters
|
||||||
public String getCif() { return cif; }
|
public String getCif() { return cif; }
|
||||||
public void setCif(String cif) { this.cif = cif; }
|
public void setCif(String cif) { this.cif = cif; }
|
||||||
|
|||||||
@@ -134,7 +134,9 @@ public class IpksCustomerRequest {
|
|||||||
@JsonAlias({"relative_name"})
|
@JsonAlias({"relative_name"})
|
||||||
private String relativeName;
|
private String relativeName;
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
|
@NotBlank(message = "bankId must not be blank")
|
||||||
|
@JsonProperty("bankId")
|
||||||
private String bankId;
|
private String bankId;
|
||||||
|
|
||||||
|
|
||||||
@@ -142,6 +144,7 @@ public class IpksCustomerRequest {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ===== Getters & Setters (camelCase) =====
|
// ===== Getters & Setters (camelCase) =====
|
||||||
|
|
||||||
public String getFirstName() {
|
public String getFirstName() {
|
||||||
|
|||||||
@@ -113,6 +113,7 @@ public class CbsIntegrationService {
|
|||||||
// ---------------- Account Creation (API-1 + API-2) ----------------
|
// ---------------- Account Creation (API-1 + API-2) ----------------
|
||||||
public AccountCreationResponse createAccount(IpksAccountRequest reqDto) {
|
public AccountCreationResponse createAccount(IpksAccountRequest reqDto) {
|
||||||
try {
|
try {
|
||||||
|
log.info("BANK-ID- {}",reqDto.getBankId());
|
||||||
String token = tokenService.getToken(reqDto.getBankId());
|
String token = tokenService.getToken(reqDto.getBankId());
|
||||||
HttpHeaders headers = buildHeaders(token);
|
HttpHeaders headers = buildHeaders(token);
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,12 @@ public class TokenService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getToken(String bankId) {
|
public String getToken(String bankId) {
|
||||||
|
|
||||||
|
if (bankId == null || bankId.isBlank()) {
|
||||||
|
log.error("Invalid bankId received: {}", bankId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
long now = System.currentTimeMillis();
|
long now = System.currentTimeMillis();
|
||||||
String cachedToken = tokenCache.get(bankId);
|
String cachedToken = tokenCache.get(bankId);
|
||||||
Long expiry = expiryCache.get(bankId);
|
Long expiry = expiryCache.get(bankId);
|
||||||
@@ -56,6 +62,8 @@ public class TokenService {
|
|||||||
|
|
||||||
String url = tokenUrl + "/" + bankId;
|
String url = tokenUrl + "/" + bankId;
|
||||||
|
|
||||||
|
log.info("Token fetching for bank {}. url={}", bankId, url);
|
||||||
|
|
||||||
// Only 2 attempts total
|
// Only 2 attempts total
|
||||||
for (int attempt = 1; attempt <= 2; attempt++) {
|
for (int attempt = 1; attempt <= 2; attempt++) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user