first commit
This commit is contained in:
@@ -0,0 +1,89 @@
|
||||
namespace Fitness_core_BE.DTOs.PaymentGateways
|
||||
{
|
||||
// Mirrors Payment-Service's DTOs/Payments/*.cs for the HMAC-signed, per-platform
|
||||
// Cards/Payments/Refunds surface (IPaymentGatewayClient) — distinct from
|
||||
// PaymentGatewayDtos.cs, which is the X-Internal-Key admin/catalog surface.
|
||||
|
||||
public class OnboardCardRequest
|
||||
{
|
||||
public string GatewayName { get; set; } = "DirectPay";
|
||||
public string CustomerId { get; set; } = string.Empty;
|
||||
public string CardLabel { get; set; } = string.Empty;
|
||||
public string CardholderName { get; set; } = string.Empty;
|
||||
public bool IsDefault { get; set; } = false;
|
||||
public string? ReturnUrl { get; set; }
|
||||
}
|
||||
|
||||
public class OnboardCardResult
|
||||
{
|
||||
public string Status { get; set; } = string.Empty;
|
||||
public string? RedirectUrl { get; set; }
|
||||
public string CardToken { get; set; } = string.Empty;
|
||||
public string MaskedPan { get; set; } = string.Empty;
|
||||
public string CardLabel { get; set; } = string.Empty;
|
||||
public string CardBrand { get; set; } = string.Empty;
|
||||
public int ExpiryMonth { get; set; }
|
||||
public int ExpiryYear { get; set; }
|
||||
public bool IsDefault { get; set; }
|
||||
public string GatewayRef { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class CardDetailsResult
|
||||
{
|
||||
public string CardToken { get; set; } = string.Empty;
|
||||
public string MaskedPan { get; set; } = string.Empty;
|
||||
public string CardLabel { get; set; } = string.Empty;
|
||||
public string CardBrand { get; set; } = string.Empty;
|
||||
public int ExpiryMonth { get; set; }
|
||||
public int ExpiryYear { get; set; }
|
||||
public bool IsDefault { get; set; }
|
||||
public string GatewayName { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class AttemptPaymentRequest
|
||||
{
|
||||
public string IdempotencyKey { get; set; } = string.Empty;
|
||||
public string GatewayName { get; set; } = "DirectPay";
|
||||
public string CardToken { get; set; } = string.Empty;
|
||||
public decimal AmountMinorUnits { get; set; }
|
||||
public string Currency { get; set; } = "LKR";
|
||||
public string Description { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class AttemptPaymentResult
|
||||
{
|
||||
public Guid PaymentId { get; set; }
|
||||
public string Status { get; set; } = string.Empty;
|
||||
public string? GatewayRef { get; set; }
|
||||
public DateTime CreatedAtUtc { get; set; }
|
||||
}
|
||||
|
||||
public class RefundPaymentResult
|
||||
{
|
||||
public Guid PaymentId { get; set; }
|
||||
public string Status { get; set; } = string.Empty;
|
||||
public string GatewayRef { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class SetDefaultCardResult
|
||||
{
|
||||
public string CardToken { get; set; } = string.Empty;
|
||||
public bool IsDefault { get; set; }
|
||||
}
|
||||
|
||||
public class PaymentListItemResult
|
||||
{
|
||||
public Guid PaymentId { get; set; }
|
||||
public decimal AmountMinorUnits { get; set; }
|
||||
public string Currency { get; set; } = string.Empty;
|
||||
public string Status { get; set; } = string.Empty;
|
||||
public DateTime CreatedAtUtc { get; set; }
|
||||
}
|
||||
|
||||
public class PaymentListResult
|
||||
{
|
||||
public int Total { get; set; }
|
||||
public int Page { get; set; }
|
||||
public List<PaymentListItemResult> Items { get; set; } = new();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
namespace Fitness_core_BE.DTOs.PaymentGateways
|
||||
{
|
||||
// Mirrors Payment-Service's DTOs/Gateways/GatewayDtos.cs - Fitness_Core_BE's
|
||||
// AdminController proxies to Payment-Service rather than exposing it directly
|
||||
// to the admin frontend (see Phase 0 decision: no admin/JWT auth surface there).
|
||||
public class GatewayDefinitionDto
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string GatewayName { get; set; } = string.Empty;
|
||||
public string DisplayName { get; set; } = string.Empty;
|
||||
public bool IsEnabled { get; set; }
|
||||
public bool IsDefault { get; set; }
|
||||
public string Mode { get; set; } = "Sandbox";
|
||||
public bool SupportsWebhooks { get; set; }
|
||||
}
|
||||
|
||||
public class UpsertGatewayDefinitionRequest
|
||||
{
|
||||
public string GatewayName { get; set; } = string.Empty;
|
||||
public string DisplayName { get; set; } = string.Empty;
|
||||
public bool IsEnabled { get; set; } = true;
|
||||
public bool IsDefault { get; set; } = false;
|
||||
public string Mode { get; set; } = "Sandbox";
|
||||
public bool SupportsWebhooks { get; set; } = true;
|
||||
}
|
||||
|
||||
public class SetGatewayEnabledRequest
|
||||
{
|
||||
public bool IsEnabled { get; set; }
|
||||
}
|
||||
|
||||
public class UpsertPlatformGatewayCredentialRequest
|
||||
{
|
||||
public Guid PlatformId { get; set; }
|
||||
public string GatewayName { get; set; } = string.Empty;
|
||||
public string CredentialsJson { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user