feat: remove deprecated account info endpoints and update request context structure in UidService

This commit is contained in:
2025-10-16 10:20:02 +03:30
parent 37a6920a74
commit a5e68cbd90
3 changed files with 13 additions and 26 deletions

View File

@@ -129,6 +129,8 @@ public class AccountToIbanResponse:UidBaseResponse
public class IbanInquiryResponse:UidBaseResponse
{
public IbanInquiryAccountBasicInformation AccountBasicInformation { get; set; }
[JsonProperty("owners")]
public List<IbanInquiryOwner> Owners { get; set; }
}
public class IbanInquiryAccountBasicInformation
@@ -137,7 +139,7 @@ public class IbanInquiryAccountBasicInformation
public string AccountNumber { get; set; }
public IbanInquiryBankInformation BankInformation { get; set; }
public string AccountStatus { get; set; }
public List<IbanInquiryOwner> Owners { get; set; }
}
public class IbanInquiryBankInformation
@@ -147,9 +149,13 @@ public class IbanInquiryBankInformation
public class IbanInquiryOwner
{
[JsonProperty("firstName")]
public string FirstName { get; set; }
[JsonProperty("lastName")]
public string LastName { get; set; }
[JsonProperty("nationalIdentifier")]
public string NationalIdentifier { get; set; }
[JsonProperty("customerType")]
public string CustomerType { get; set; }
}

View File

@@ -154,13 +154,14 @@ public class UidService : IUidService
{
var request = new
{
Iban = iban,
RequestContext = new UidRequestContext()
iban,
requestContext = new UidRequestContext()
};
var json = JsonConvert.SerializeObject(request);
var contentType = new StringContent(json, Encoding.UTF8, "application/json");
var requestResult = await _httpClient.PostAsync("inquiry/iban/v2", contentType);
requestResult.EnsureSuccessStatusCode();
//var stringRes =await requestResult.Content.ReadAsStringAsync();
var responseResult = await requestResult.Content.ReadFromJsonAsync<IbanInquiryResponse>();
return responseResult;
}
@@ -171,7 +172,7 @@ public class UidService : IUidService
{
accountNumber,
bank,
RequestContext = new UidRequestContext()
requestContext = new UidRequestContext()
};
var json = JsonConvert.SerializeObject(request);
var contentType = new StringContent(json, Encoding.UTF8, "application/json");
@@ -186,11 +187,11 @@ public class UidService : IUidService
var request = new
{
cardNumber,
RequestContext = new UidRequestContext()
requestContext = new UidRequestContext()
};
var json = JsonConvert.SerializeObject(request);
var contentType = new StringContent(json, Encoding.UTF8, "application/json");
var requestResult = await _httpClient.PostAsync("account-to-iban", contentType);
var requestResult = await _httpClient.PostAsync("inquiry/card", contentType);
requestResult.EnsureSuccessStatusCode();
var responseResult = await requestResult.Content.ReadFromJsonAsync<CardToNumberResponse>();
return responseResult;

View File

@@ -71,26 +71,6 @@ public class DashboardController : AdminBaseController
var result = (int)await _smsService.GetCreditAmount();
return new SmsRemainingResult(result);
}
[HttpGet("account-info")]
public async Task<ActionResult> OnGetAccountInfo(string cardNumber)
{
var cardToNumberResponse = await _uidService.CardToIban(cardNumber);
return Ok(cardToNumberResponse);
}
[HttpGet("account-info2")]
public async Task<ActionResult> OnGetAccountInfo2(string iban)
{
var cardToNumberResponse = await _uidService.IbanInquiry(iban);
return Ok(cardToNumberResponse);
}
[HttpGet("account-info3")]
public async Task<ActionResult> OnGetAccountInfo3(string accountNumber, UidBanks banks)
{
var cardToNumberResponse = await _uidService.AccountToIban(accountNumber, banks);
return Ok(cardToNumberResponse);
}
}
public record SmsRemainingResult(int Data);