using Stripe; using Transaction = Bit.Core.Entities.Transaction; namespace Bit.Billing.Services; public interface IStripeEventUtilityService { /// /// Gets the organization or user ID from the metadata of a Stripe Charge object. /// /// /// Task<(Guid?, Guid?, Guid?)> GetEntityIdsFromChargeAsync(Charge charge); /// /// Gets the organizationId, userId, or providerId from the metadata of a Stripe Subscription object. /// /// /// Tuple GetIdsFromMetadata(Dictionary metadata); /// /// Determines whether the specified subscription is a sponsored subscription. /// /// The subscription to be evaluated. /// /// A boolean value indicating whether the subscription is a sponsored subscription. /// Returns true if the subscription matches any of the sponsored plans; otherwise, false. /// bool IsSponsoredSubscription(Subscription subscription); /// /// Converts a Stripe Charge object to a Bitwarden Transaction object. /// /// /// /// /// /// /// Transaction FromChargeToTransaction(Charge charge, Guid? organizationId, Guid? userId, Guid? providerId); /// /// Attempts to pay the specified invoice. If a customer is eligible, the invoice is paid using Braintree or Stripe. /// /// The invoice to be paid. /// Indicates whether to attempt payment with Stripe. Defaults to false. /// A task representing the asynchronous operation. The task result contains a boolean value indicating whether the invoice payment attempt was successful. Task AttemptToPayInvoiceAsync(Invoice invoice, bool attemptToPayWithStripe = false); /// /// Determines whether an invoice should be attempted to be paid based on certain criteria. /// /// The invoice to be evaluated. /// A boolean value indicating whether the invoice should be attempted to be paid. bool ShouldAttemptToPayInvoice(Invoice invoice); /// /// The ID for the premium annual plan. /// const string PremiumPlanId = "premium-annually"; /// /// The ID for the premium annual plan via the App Store. /// const string PremiumPlanIdAppStore = "premium-annually-app"; }