removed @IgnoreJson from bankId
This commit is contained in:
@@ -19,8 +19,11 @@ 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;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -134,8 +134,11 @@ 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;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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