LatticeStripe.Testing.Fixtures.Entitlements (LatticeStripe v2.0.0)

Copy Markdown View Source

Canonical raw fixtures for Stripe entitlement objects.

Summary

Functions

Wire-shaped entitlements.active_entitlement fixture.

Stripe list envelope wrapping one or more active entitlement fixtures.

Wire-shaped entitlements.active_entitlement_summary fixture.

Wire-shaped entitlements.feature fixture.

Functions

active_entitlement_json(overrides \\ %{})

@spec active_entitlement_json(map()) :: map()

Wire-shaped entitlements.active_entitlement fixture.

Returns a string-keyed map matching Stripe's wire format. The feature value is the unexpanded bare feat_ id string; pass %{"feature" => feature_json()} to exercise the expanded form.

active_entitlement_list_json(items \\ [active_entitlement_json()], has_more \\ false)

@spec active_entitlement_list_json(list(), boolean()) :: map()

Stripe list envelope wrapping one or more active entitlement fixtures.

active_entitlement_summary_json(overrides \\ %{})

@spec active_entitlement_summary_json(map()) :: map()

Wire-shaped entitlements.active_entitlement_summary fixture.

The nested entitlements envelope carries the un-rewritten webhook url "/v1/customer/cus_ABC123customer/entitlements" — the exact string Stripe publishes. The summary module rewrites it to the canonical list path, so the fixture must carry the original for that rewrite to be provable.

feature_json(overrides \\ %{})

@spec feature_json(map()) :: map()

Wire-shaped entitlements.feature fixture.