From 139ca1f8663d8b5b027576923140a5baec55536a Mon Sep 17 00:00:00 2001 From: Khwezi Mngoma Date: Mon, 1 Jun 2026 23:32:35 +0200 Subject: [PATCH] Fixed event service scope issue --- .../PayfastPaymentConfirmationReceivedEventHandler.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/LiteCharms.Features.MidrandBooks/Payments/Events/Handlers/PayfastPaymentConfirmationReceivedEventHandler.cs b/LiteCharms.Features.MidrandBooks/Payments/Events/Handlers/PayfastPaymentConfirmationReceivedEventHandler.cs index 371c07b..96682ed 100644 --- a/LiteCharms.Features.MidrandBooks/Payments/Events/Handlers/PayfastPaymentConfirmationReceivedEventHandler.cs +++ b/LiteCharms.Features.MidrandBooks/Payments/Events/Handlers/PayfastPaymentConfirmationReceivedEventHandler.cs @@ -3,10 +3,13 @@ using LiteCharms.Features.MidrandBooks.Orders; namespace LiteCharms.Features.MidrandBooks.Payments.Events.Handlers; -public sealed class PayfastPaymentConfirmationReceivedEventHandler(PaymentService paymentService, - HashService hashService, OrderService orderService, ILogger logger) : +public sealed class PayfastPaymentConfirmationReceivedEventHandler(IServiceProvider services, ILogger logger) : INotificationHandler { + private readonly PaymentService paymentService = services.GetRequiredService(); + private readonly OrderService orderService = services.GetRequiredService(); + private readonly HashService hashService = services.GetRequiredService(); + public async ValueTask Handle(PayfastPaymentConfirmationReceivedEvent notification, CancellationToken cancellationToken) { var hashResult = hashService.DecodeLongIdHash(notification.Payload?.MPaymentId!);