View Source Plausible.Billing.Plans (Plausible v0.0.1)
Summary
Functions
Returns a list of growth plans available for the user to choose.
Returns the most appropriate plan for a user based on their usage during a given cycle.
This function takes a list of plans as an argument, gathers all product
IDs in a single list, and makes an API call to Paddle. After a successful
response, fills in the monthly_cost
and yearly_cost
fields for each
given plan and returns the new list of plans with completed information.
List yearly plans product IDs.
Functions
Returns a list of growth plans available for the user to choose.
As new versions of plans are introduced, users who were on old plans can still choose from old plans.
@spec suggest(Plausible.Auth.User.t(), non_neg_integer()) :: Plausible.Billing.Plan.t()
Returns the most appropriate plan for a user based on their usage during a given cycle.
If the usage during the cycle exceeds the enterprise-level threshold, or if the user already belongs to an enterprise plan, it suggests the :enterprise plan.
Otherwise, it recommends the plan where the cycle usage falls just under the plan's limit from the available options for the user.
This function takes a list of plans as an argument, gathers all product
IDs in a single list, and makes an API call to Paddle. After a successful
response, fills in the monthly_cost
and yearly_cost
fields for each
given plan and returns the new list of plans with completed information.
@spec yearly_product_ids() :: [String.t()]
List yearly plans product IDs.