BCards/src/BCards.Web/Services/IPaymentService.cs
Ricardo Carneiro 6e70202fce
All checks were successful
BCards Deployment Pipeline / Run Tests (push) Successful in 3s
BCards Deployment Pipeline / PR Validation (push) Has been skipped
BCards Deployment Pipeline / Build and Push Image (push) Successful in 15m47s
BCards Deployment Pipeline / Deploy to Production (ARM - OCI) (push) Successful in 1m12s
BCards Deployment Pipeline / Deploy to Staging (x86 - Local) (push) Has been skipped
BCards Deployment Pipeline / Cleanup Old Resources (push) Has been skipped
BCards Deployment Pipeline / Deployment Summary (push) Successful in 0s
feat: reativar assinatura cancelada
2025-09-07 17:00:50 -03:00

27 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<bool> ReactivateSubscriptionAsync(string subscriptionId);
Task<Refund> CreatePartialRefundAsync(string subscriptionId, decimal refundAmount);
Task<(bool CanRefundFull, bool CanRefundPartial, decimal RefundAmount)> CalculateRefundAsync(string subscriptionId);
}