Fixed event service scope issue
continuous-integration/drone/pr Build is passing

This commit is contained in:
Khwezi Mngoma
2026-06-01 23:32:35 +02:00
parent 45c2e8310a
commit 139ca1f866
@@ -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<PayfastPaymentConfirmationReceivedEvent> logger) :
public sealed class PayfastPaymentConfirmationReceivedEventHandler(IServiceProvider services, ILogger<PayfastPaymentConfirmationReceivedEvent> logger) :
INotificationHandler<PayfastPaymentConfirmationReceivedEvent>
{
private readonly PaymentService paymentService = services.GetRequiredService<PaymentService>();
private readonly OrderService orderService = services.GetRequiredService<OrderService>();
private readonly HashService hashService = services.GetRequiredService<HashService>();
public async ValueTask Handle(PayfastPaymentConfirmationReceivedEvent notification, CancellationToken cancellationToken)
{
var hashResult = hashService.DecodeLongIdHash(notification.Payload?.MPaymentId!);