BCards/src/BCards.Web/Services/IPaymentService.cs
2025-08-20 22:56:36 -03:00

26 lines
1.4 KiB
C#

using BCards.Web.Models;
using Stripe;
namespace BCards.Web.Services;
public interface IPaymentService
{
Task<string> CreateCheckoutSessionAsync(string userId, string planType, string returnUrl, string cancelUrl);
Task<Customer> CreateOrGetCustomerAsync(string userId, string email, string name);
Task<Stripe.Subscription> HandleWebhookAsync(string requestBody, string signature);
Task<List<Price>> GetPricesAsync();
Task<bool> CancelSubscriptionAsync(string subscriptionId);
Task<Stripe.Subscription> UpdateSubscriptionAsync(string subscriptionId, string newPriceId);
Task<PlanLimitations> GetPlanLimitationsAsync(string planType);
// Novos métodos para gerenciamento de assinatura
Task<Stripe.Subscription?> GetSubscriptionDetailsAsync(string userId);
Task<List<Invoice>> GetPaymentHistoryAsync(string userId);
Task<string> CreatePortalSessionAsync(string customerId, string returnUrl);
// Métodos para cancelamento com diferentes políticas
Task<bool> CancelSubscriptionImmediatelyAsync(string subscriptionId, bool refund = false);
Task<bool> CancelSubscriptionAtPeriodEndAsync(string subscriptionId);
Task<Refund> CreatePartialRefundAsync(string subscriptionId, decimal refundAmount);
Task<(bool CanRefundFull, bool CanRefundPartial, decimal RefundAmount)> CalculateRefundAsync(string subscriptionId);
}