Added payment gateway ledger service to payments feature
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
namespace LiteCharms.Features.MidrandBooks.Payments.Models;
|
||||
|
||||
public sealed class PayfastWebhookPayload
|
||||
{
|
||||
public string? MerchantId { get; set; }
|
||||
|
||||
public string? MerchantKey { get; set; }
|
||||
|
||||
public string? Signature { get; set; }
|
||||
|
||||
public string? MerchantPaymentId { get; set; }
|
||||
|
||||
public string? PaymentId { get; set; }
|
||||
|
||||
public string? PaymentStatus { get; set; }
|
||||
|
||||
public string? ItemName { get; set; }
|
||||
|
||||
public string? ItemDescription { get; set; }
|
||||
|
||||
public string? AmountGross { get; set; }
|
||||
|
||||
public string? AmountFee { get; set; }
|
||||
|
||||
public string? AmountNet { get; set; }
|
||||
|
||||
public string? NameFirst { get; set; }
|
||||
|
||||
public string? NameLast { get; set; }
|
||||
|
||||
public string? EmailAddress { get; set; }
|
||||
|
||||
public string? CustomStr1 { get; set; }
|
||||
|
||||
public string? CustomInt1 { get; set; }
|
||||
|
||||
public string? Token { get; set; }
|
||||
|
||||
public IDictionary<string, string?> ToParamDictionary() => new Dictionary<string, string?>
|
||||
(StringComparer.Ordinal)
|
||||
{
|
||||
{ "merchant_id", MerchantId },
|
||||
{ "merchant_key", MerchantKey },
|
||||
{ "m_payment_id", MerchantPaymentId },
|
||||
{ "pf_payment_id", PaymentId },
|
||||
{ "payment_status", PaymentStatus },
|
||||
{ "item_name", ItemName },
|
||||
{ "item_description", ItemDescription },
|
||||
{ "amount_gross", AmountGross },
|
||||
{ "amount_fee", AmountFee },
|
||||
{ "amount_net", AmountNet },
|
||||
{ "custom_str1", CustomStr1 },
|
||||
{ "custom_int1", CustomInt1 },
|
||||
{ "name_first", NameFirst },
|
||||
{ "name_last", NameLast },
|
||||
{ "email_address", EmailAddress },
|
||||
{ "token", Token }
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
namespace LiteCharms.Features.MidrandBooks.Payments.Models;
|
||||
|
||||
public class PaymentGatewayLedger
|
||||
{
|
||||
public long Id { get; set; }
|
||||
|
||||
public DateTime CreatedAt { get; set; }
|
||||
|
||||
public string? CustomerEmail { get; set; }
|
||||
|
||||
public long OrderId { get; set; }
|
||||
|
||||
public long PaymentId { get; set; }
|
||||
|
||||
public string? MerchantPaymentId { get; set; }
|
||||
|
||||
public string? PayfastPaymentId { get; set; }
|
||||
|
||||
public string? PaymentStatus { get; set; }
|
||||
|
||||
public decimal AmountGross { get; set; }
|
||||
|
||||
public decimal AmountFee { get; set; }
|
||||
|
||||
public decimal AmountNet { get; set; }
|
||||
}
|
||||
@@ -14,7 +14,5 @@ public class PaymentLedger
|
||||
|
||||
public long CustomerId { get; set; }
|
||||
|
||||
public string? PaymentGatewayReference { get; set; }
|
||||
|
||||
public long? PaymentGatewayId { get; set; }
|
||||
public string? MerchantPaymentId { get; set; }
|
||||
}
|
||||
|
||||
@@ -1,5 +1,26 @@
|
||||
namespace LiteCharms.Features.MidrandBooks.Payments.Models;
|
||||
|
||||
public sealed record CreateGatewayLedgerEntry
|
||||
{
|
||||
public string? CustomerEmail { get; set; }
|
||||
|
||||
public required long OrderId { get; set; }
|
||||
|
||||
public required long PaymentId { get; set; }
|
||||
|
||||
public string? MerchantPaymentId { get; set; }
|
||||
|
||||
public string? PayfastPaymentId { get; set; }
|
||||
|
||||
public string? PaymentStatus { get; set; }
|
||||
|
||||
public decimal AmountGross { get; set; }
|
||||
|
||||
public decimal AmountFee { get; set; }
|
||||
|
||||
public decimal AmountNet { get; set; }
|
||||
}
|
||||
|
||||
public sealed record UpdateRefund
|
||||
{
|
||||
public long OrderId { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user