1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-04 09:32:48 -05:00

[AC-1942] Add endpoint to get provider invoices (#4158)

* Added endpoint to get provider invoices

* Added missing properties of invoice

* Run dotnet format'
This commit is contained in:
Alex Morask
2024-06-05 13:33:28 -04:00
committed by GitHub
parent 4a6113dc86
commit a0a7654077
6 changed files with 389 additions and 121 deletions

View File

@ -25,6 +25,23 @@ public class ProviderBillingController(
IStripeAdapter stripeAdapter,
ISubscriberService subscriberService) : Controller
{
[HttpGet("invoices")]
public async Task<IResult> GetInvoicesAsync([FromRoute] Guid providerId)
{
var (provider, result) = await GetAuthorizedBillableProviderOrResultAsync(providerId);
if (provider == null)
{
return result;
}
var invoices = await subscriberService.GetInvoices(provider);
var response = InvoicesResponse.From(invoices);
return TypedResults.Ok(response);
}
[HttpGet("payment-information")]
public async Task<IResult> GetPaymentInformationAsync([FromRoute] Guid providerId)
{