LatticeStripe.Price.Recurring (LatticeStripe v1.7.12)

Copy Markdown View Source

Typed representation of a Price's recurring nested object.

Subscriptions and metered billing depend on pattern-matching against this struct — %LatticeStripe.Price.Recurring{interval: :month} is the idiomatic shape.

Summary

Functions

Converts a decoded Stripe recurring map to a %Price.Recurring{} struct.

Types

t()

@type t() :: %LatticeStripe.Price.Recurring{
  aggregate_usage:
    :sum | :last_during_period | :last_ever | :max | String.t() | nil,
  extra: map(),
  interval: :day | :week | :month | :year | String.t() | nil,
  interval_count: integer() | nil,
  meter: String.t() | nil,
  trial_period_days: integer() | nil,
  usage_type: :licensed | :metered | String.t() | nil
}

Functions

from_map(map)

@spec from_map(map()) :: t()

Converts a decoded Stripe recurring map to a %Price.Recurring{} struct.

Atomizes interval, usage_type, and aggregate_usage via whitelists (D-03).