1
0
mirror of https://github.com/bitwarden/server synced 2025-12-28 06:03:29 +00:00
Files
server/src/Billing/Services/Implementations/InvoiceFinalizedHandler.cs
cyprain-okeke f045d06a9c [AC-2361] Refactor StripeController (#4136)
* Changes ensures provider_id is handled and stored for Braintree.

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>

* refactoring of the stripeController class

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>

* Move the constant variables to utility class

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>

* Adding comments to the methods

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>

* Add more comments to describe the method

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>

* Add the providerId changes

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>

* Add the missing providerId

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>

* Fix the IsSponsoredSubscription bug

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>

---------

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
2024-06-26 16:34:16 +01:00

24 lines
680 B
C#

using Event = Stripe.Event;
namespace Bit.Billing.Services.Implementations;
public class InvoiceFinalizedHandler : IInvoiceFinalizedHandler
{
private readonly IProviderEventService _providerEventService;
public InvoiceFinalizedHandler(IProviderEventService providerEventService)
{
_providerEventService = providerEventService;
}
/// <summary>
/// Handles the <see cref="HandledStripeWebhook.InvoiceFinalized"/> event type from Stripe.
/// </summary>
/// <param name="parsedEvent"></param>
public async Task HandleAsync(Event parsedEvent)
{
await _providerEventService.TryRecordInvoiceLineItems(parsedEvent);
}
}