using Stripe;
namespace Bit.Billing.Services;
public interface IStripeEventService
{
///
/// Extracts the object from the Stripe . When is true,
/// uses the charge ID extracted from the event to retrieve the most up-to-update charge from Stripe's API
/// and optionally expands it with the provided options.
///
/// The Stripe webhook event.
/// Determines whether or not to retrieve a fresh copy of the charge object from Stripe.
/// Optionally provided to expand the fresh charge object retrieved from Stripe.
/// A Stripe .
/// Thrown when the Stripe event does not contain a charge object.
/// Thrown when is true and Stripe's API returns a null charge object.
Task GetCharge(Event stripeEvent, bool fresh = false, List expand = null);
///
/// Extracts the object from the Stripe . When is true,
/// uses the customer ID extracted from the event to retrieve the most up-to-update customer from Stripe's API
/// and optionally expands it with the provided options.
///
/// The Stripe webhook event.
/// Determines whether or not to retrieve a fresh copy of the customer object from Stripe.
/// Optionally provided to expand the fresh customer object retrieved from Stripe.
/// A Stripe .
/// Thrown when the Stripe event does not contain a customer object.
/// Thrown when is true and Stripe's API returns a null customer object.
Task GetCustomer(Event stripeEvent, bool fresh = false, List expand = null);
///
/// Extracts the object from the Stripe . When is true,
/// uses the invoice ID extracted from the event to retrieve the most up-to-update invoice from Stripe's API
/// and optionally expands it with the provided options.
///
/// The Stripe webhook event.
/// Determines whether or not to retrieve a fresh copy of the invoice object from Stripe.
/// Optionally provided to expand the fresh invoice object retrieved from Stripe.
/// A Stripe .
/// Thrown when the Stripe event does not contain an invoice object.
/// Thrown when is true and Stripe's API returns a null invoice object.
Task GetInvoice(Event stripeEvent, bool fresh = false, List expand = null);
///
/// Extracts the object from the Stripe . When is true,
/// uses the payment method ID extracted from the event to retrieve the most up-to-update payment method from Stripe's API
/// and optionally expands it with the provided options.
///
/// The Stripe webhook event.
/// Determines whether or not to retrieve a fresh copy of the payment method object from Stripe.
/// Optionally provided to expand the fresh payment method object retrieved from Stripe.
/// A Stripe .
/// Thrown when the Stripe event does not contain an payment method object.
/// Thrown when is true and Stripe's API returns a null payment method object.
Task GetPaymentMethod(Event stripeEvent, bool fresh = false, List expand = null);
///
/// Extracts the object from the Stripe . When is true,
/// uses the subscription ID extracted from the event to retrieve the most up-to-update subscription from Stripe's API
/// and optionally expands it with the provided options.
///
/// The Stripe webhook event.
/// Determines whether or not to retrieve a fresh copy of the subscription object from Stripe.
/// Optionally provided to expand the fresh subscription object retrieved from Stripe.
/// A Stripe .
/// Thrown when the Stripe event does not contain an subscription object.
/// Thrown when is true and Stripe's API returns a null subscription object.
Task GetSubscription(Event stripeEvent, bool fresh = false, List expand = null);
///
/// Ensures that the customer associated with the Stripe is in the correct region for this server.
/// We use the customer instead of the subscription given that all subscriptions have customers, but not all
/// customers have subscriptions.
///
/// The Stripe webhook event.
/// True if the customer's region and the server's region match, otherwise false.
Task ValidateCloudRegion(Event stripeEvent);
}