mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 23:52:50 -05:00
[PM-15048] Update bank account verification to use descriptor code (#5048)
* Update verify bank account process to use descriptor code * Run dotnet format
This commit is contained in:
@ -206,6 +206,11 @@ public class OrganizationBillingController(
|
||||
return Error.Unauthorized();
|
||||
}
|
||||
|
||||
if (requestBody.DescriptorCode.Length != 6 || !requestBody.DescriptorCode.StartsWith("SM"))
|
||||
{
|
||||
return Error.BadRequest("Statement descriptor should be a 6-character value that starts with 'SM'");
|
||||
}
|
||||
|
||||
var organization = await organizationRepository.GetByIdAsync(organizationId);
|
||||
|
||||
if (organization == null)
|
||||
@ -213,7 +218,7 @@ public class OrganizationBillingController(
|
||||
return Error.NotFound();
|
||||
}
|
||||
|
||||
await subscriberService.VerifyBankAccount(organization, (requestBody.Amount1, requestBody.Amount2));
|
||||
await subscriberService.VerifyBankAccount(organization, requestBody.DescriptorCode);
|
||||
|
||||
return TypedResults.Ok();
|
||||
}
|
||||
|
@ -4,8 +4,6 @@ namespace Bit.Api.Billing.Models.Requests;
|
||||
|
||||
public class VerifyBankAccountRequestBody
|
||||
{
|
||||
[Range(0, 99)]
|
||||
public long Amount1 { get; set; }
|
||||
[Range(0, 99)]
|
||||
public long Amount2 { get; set; }
|
||||
[Required]
|
||||
public string DescriptorCode { get; set; }
|
||||
}
|
||||
|
Reference in New Issue
Block a user