1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-21 12:05:42 +01:00

Fix invoice finalized handler (#4430)

This commit is contained in:
Alex Morask 2024-06-28 08:48:56 -04:00 committed by GitHub
parent 04ab3d4c2e
commit 48430836b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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<StripeEventProcessor> 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);