mirror of
https://github.com/bitwarden/server.git
synced 2024-11-26 12:55:17 +01:00
r
This commit is contained in:
parent
e77430823c
commit
52f8d9571c
@ -1,6 +1,4 @@
|
||||
using Bit.Api.Billing.Models.Responses;
|
||||
using Bit.Core.Billing.Services;
|
||||
using Bit.Core.Services;
|
||||
using Bit.Core.Services;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http.HttpResults;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@ -10,8 +8,7 @@ namespace Bit.Api.Billing.Controllers;
|
||||
|
||||
[Authorize("Application")]
|
||||
public class StripeController(
|
||||
IStripeAdapter stripeAdapter,
|
||||
ITaxService taxService) : Controller
|
||||
IStripeAdapter stripeAdapter) : Controller
|
||||
{
|
||||
[HttpPost]
|
||||
[Route("~/setup-intent/bank-account")]
|
||||
@ -49,13 +46,4 @@ public class StripeController(
|
||||
|
||||
return TypedResults.Ok(setupIntent.ClientSecret);
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[AllowAnonymous]
|
||||
[Route("~/tax/id-types")]
|
||||
public IResult GetTaxIdTypes()
|
||||
{
|
||||
var response = TaxIdTypesResponse.From(taxService.GetTaxIdTypes());
|
||||
return TypedResults.Ok(response);
|
||||
}
|
||||
}
|
||||
|
@ -1,28 +0,0 @@
|
||||
using Bit.Core.Billing.Models;
|
||||
|
||||
namespace Bit.Api.Billing.Models.Responses;
|
||||
|
||||
public record TaxIdTypesResponse(List<TaxIdTypeResponse> TaxIdTypes)
|
||||
{
|
||||
public static TaxIdTypesResponse From(IEnumerable<TaxIdType> taxIdTypes) => new(
|
||||
taxIdTypes.Select(TaxIdTypeResponse.From).ToList());
|
||||
}
|
||||
|
||||
|
||||
/// <param name="Code">Stripe short code for the tax ID type</param>
|
||||
/// <param name="Country">ISO-3166-2 country code</param>
|
||||
/// <param name="Description">Description of the tax ID type</param>
|
||||
/// <param name="Example">Example of the tax ID type</param>
|
||||
public record TaxIdTypeResponse(
|
||||
string Code,
|
||||
string Country,
|
||||
string Description,
|
||||
string Example)
|
||||
{
|
||||
public static TaxIdTypeResponse From(TaxIdType taxIdType)
|
||||
=> new(
|
||||
taxIdType.Code,
|
||||
taxIdType.Country,
|
||||
taxIdType.Description,
|
||||
taxIdType.Example);
|
||||
}
|
Loading…
Reference in New Issue
Block a user