1
0
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:
Alex Morask
2024-11-20 14:36:50 -05:00
committed by GitHub
parent eb20adb53e
commit 052235bed6
7 changed files with 56 additions and 38 deletions

View File

@ -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();
}

View File

@ -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; }
}