27 lines
1.9 KiB
C#
27 lines
1.9 KiB
C#
using Fitness_core_BE.DTOs.PaymentGateways;
|
|
|
|
namespace Fitness_core_BE.Interfaces.Services
|
|
{
|
|
// Server-to-server client for Payment-Service's HMAC-signed, per-platform routes
|
|
// (Controllers/v1/CardsController.cs, PaymentsController.cs, RefundsController.cs there).
|
|
// Distinct from IPaymentServiceClient, which calls the X-Internal-Key admin/catalog surface.
|
|
// Every method here is scoped to one gym client and lazily provisions that client's
|
|
// Payment-Service Platform on first use (see PaymentGatewayClient.EnsureCredentialsAsync).
|
|
public interface IPaymentGatewayClient
|
|
{
|
|
Task<OnboardCardResult> OnboardCardAsync(Guid clientId, OnboardCardRequest request, CancellationToken ct = default);
|
|
Task<CardDetailsResult> GetCardDetailsAsync(Guid clientId, string cardToken, CancellationToken ct = default);
|
|
Task<IReadOnlyCollection<CardDetailsResult>> ListCardsAsync(Guid clientId, string customerId, CancellationToken ct = default);
|
|
Task DeactivateCardAsync(Guid clientId, string cardToken, CancellationToken ct = default);
|
|
Task<SetDefaultCardResult> SetDefaultCardAsync(Guid clientId, string cardToken, string customerId, CancellationToken ct = default);
|
|
|
|
/// <summary>Polls a hosted-page onboarding started earlier (CardToken is empty until
|
|
/// the gateway's webhook completes it — see Payment-Service's CardService).</summary>
|
|
Task<OnboardCardResult> GetOnboardingStatusAsync(Guid clientId, string gatewayName, string sessionId, CancellationToken ct = default);
|
|
|
|
Task<AttemptPaymentResult> AttemptPaymentAsync(Guid clientId, AttemptPaymentRequest request, CancellationToken ct = default);
|
|
Task<RefundPaymentResult> RefundPaymentAsync(Guid clientId, Guid paymentId, bool isVoid, CancellationToken ct = default);
|
|
Task<PaymentListResult> ListPaymentsAsync(Guid clientId, string? cardToken, int page, int pageSize, CancellationToken ct = default);
|
|
}
|
|
}
|