Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 73ef4b04a9 | |||
| 5ab2d29aac | |||
| 780415b6d4 | |||
| 139ca1f866 |
+7
-2
@@ -3,12 +3,17 @@ 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>
|
||||||
{
|
{
|
||||||
public async ValueTask Handle(PayfastPaymentConfirmationReceivedEvent notification, CancellationToken cancellationToken)
|
public async ValueTask Handle(PayfastPaymentConfirmationReceivedEvent notification, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
await using var scope = services.CreateAsyncScope();
|
||||||
|
|
||||||
|
PaymentService paymentService = scope.ServiceProvider.GetRequiredService<PaymentService>();
|
||||||
|
OrderService orderService = scope.ServiceProvider.GetRequiredService<OrderService>();
|
||||||
|
HashService hashService = scope.ServiceProvider.GetRequiredService<HashService>();
|
||||||
|
|
||||||
var hashResult = hashService.DecodeLongIdHash(notification.Payload?.MPaymentId!);
|
var hashResult = hashService.DecodeLongIdHash(notification.Payload?.MPaymentId!);
|
||||||
if (hashResult.IsFailed)
|
if (hashResult.IsFailed)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user