using LiteCharms.Features.Abstractions; using LiteCharms.Features.MidrandBooks.Payments.Models; namespace LiteCharms.Features.MidrandBooks.Payments.Events; public sealed class PayfastPaymentConfirmationReceivedEvent : EventBase, IEvent { public string Name { get; set; } = nameof(PayfastPaymentConfirmationReceivedEvent); public PayfastWebhookPayload? Payload { get; set; } public string? RemoteIpAddress { get; set; } public bool PerformBackgroundChecks { get; set; } public bool AllowLoopback { get; set; } public PayfastPaymentConfirmationReceivedEvent() { } private PayfastPaymentConfirmationReceivedEvent(PayfastWebhookPayload? payload, string paymentId, bool performBackgroundChecks = true, bool allowLoopback = false) { Payload = payload; CorrelationId = paymentId; PerformBackgroundChecks = performBackgroundChecks; AllowLoopback = allowLoopback; } public static PayfastPaymentConfirmationReceivedEvent Create(PayfastWebhookPayload? payload, string paymentId, bool performBackgroundChecks = true, bool allowLoopback = false) => new(payload, paymentId, performBackgroundChecks, allowLoopback); }