From 48430836b65dc111edf9614ada9f2158602b47f7 Mon Sep 17 00:00:00 2001 From: Alex Morask <144709477+amorask-bitwarden@users.noreply.github.com> Date: Fri, 28 Jun 2024 08:48:56 -0400 Subject: [PATCH] Fix invoice finalized handler (#4430) --- .../Services/Implementations/StripeEventProcessor.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Billing/Services/Implementations/StripeEventProcessor.cs b/src/Billing/Services/Implementations/StripeEventProcessor.cs index db4e3929f..b0d9cf187 100644 --- a/src/Billing/Services/Implementations/StripeEventProcessor.cs +++ b/src/Billing/Services/Implementations/StripeEventProcessor.cs @@ -16,6 +16,7 @@ public class StripeEventProcessor : IStripeEventProcessor private readonly IInvoiceCreatedHandler _invoiceCreatedHandler; private readonly IPaymentMethodAttachedHandler _paymentMethodAttachedHandler; private readonly ICustomerUpdatedHandler _customerUpdatedHandler; + private readonly IInvoiceFinalizedHandler _invoiceFinalizedHandler; public StripeEventProcessor( ILogger logger, @@ -28,7 +29,8 @@ public class StripeEventProcessor : IStripeEventProcessor IPaymentFailedHandler paymentFailedHandler, IInvoiceCreatedHandler invoiceCreatedHandler, IPaymentMethodAttachedHandler paymentMethodAttachedHandler, - ICustomerUpdatedHandler customerUpdatedHandler) + ICustomerUpdatedHandler customerUpdatedHandler, + IInvoiceFinalizedHandler invoiceFinalizedHandler) { _logger = logger; _subscriptionDeletedHandler = subscriptionDeletedHandler; @@ -41,6 +43,7 @@ public class StripeEventProcessor : IStripeEventProcessor _invoiceCreatedHandler = invoiceCreatedHandler; _paymentMethodAttachedHandler = paymentMethodAttachedHandler; _customerUpdatedHandler = customerUpdatedHandler; + _invoiceFinalizedHandler = invoiceFinalizedHandler; } public async Task ProcessEventAsync(Event parsedEvent) @@ -78,7 +81,7 @@ public class StripeEventProcessor : IStripeEventProcessor await _customerUpdatedHandler.HandleAsync(parsedEvent); break; case HandledStripeWebhook.InvoiceFinalized: - await _customerUpdatedHandler.HandleAsync(parsedEvent); + await _invoiceFinalizedHandler.HandleAsync(parsedEvent); break; default: _logger.LogWarning("Unsupported event received. {EventType}", parsedEvent.Type);