Merge pull request 'Fixed event service scope issue' (#58) from payments into master

Reviewed-on: #58
This commit was merged in pull request #58.
This commit is contained in:
2026-06-01 23:33:11 +02:00
@@ -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!);