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:
+5
-2
@@ -3,10 +3,13 @@ using LiteCharms.Features.MidrandBooks.Orders;
|
|||||||
|
|
||||||
namespace LiteCharms.Features.MidrandBooks.Payments.Events.Handlers;
|
namespace LiteCharms.Features.MidrandBooks.Payments.Events.Handlers;
|
||||||
|
|
||||||
public sealed class PayfastPaymentConfirmationReceivedEventHandler(PaymentService paymentService,
|
public sealed class PayfastPaymentConfirmationReceivedEventHandler(IServiceProvider services, ILogger<PayfastPaymentConfirmationReceivedEvent> logger) :
|
||||||
HashService hashService, OrderService orderService, ILogger<PayfastPaymentConfirmationReceivedEvent> logger) :
|
|
||||||
INotificationHandler<PayfastPaymentConfirmationReceivedEvent>
|
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)
|
public async ValueTask Handle(PayfastPaymentConfirmationReceivedEvent notification, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var hashResult = hashService.DecodeLongIdHash(notification.Payload?.MPaymentId!);
|
var hashResult = hashService.DecodeLongIdHash(notification.Payload?.MPaymentId!);
|
||||||
|
|||||||
Reference in New Issue
Block a user