LatticeStripe.Invoice.StatusTransitions (LatticeStripe v1.1.0)

Copy Markdown View Source

Tracks lifecycle Unix timestamps for a Stripe Invoice.

Returned as a nested field on LatticeStripe.Invoice structs. All fields are optional Unix timestamps that record when the invoice entered each lifecycle state.

Fields

  • finalized_at - Unix timestamp when the invoice was finalized (moved to open status)
  • marked_uncollectible_at - Unix timestamp when the invoice was marked uncollectible
  • paid_at - Unix timestamp when the invoice was paid
  • voided_at - Unix timestamp when the invoice was voided

Stripe API Reference

See the Stripe Invoice object for field definitions.

Summary

Types

t()

Lifecycle timestamps for a Stripe Invoice.

Functions

Converts a decoded Stripe API map to a %StatusTransitions{} struct.

Types

t()

@type t() :: %LatticeStripe.Invoice.StatusTransitions{
  finalized_at: integer() | nil,
  marked_uncollectible_at: integer() | nil,
  paid_at: integer() | nil,
  voided_at: integer() | nil
}

Lifecycle timestamps for a Stripe Invoice.

Functions

from_map(map)

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

Converts a decoded Stripe API map to a %StatusTransitions{} struct.

Returns nil when given nil (invoice has no status_transitions field).

Example

iex> LatticeStripe.Invoice.StatusTransitions.from_map(%{
...>   "finalized_at" => 1_700_000_000,
...>   "paid_at" => 1_700_000_200,
...>   "marked_uncollectible_at" => nil,
...>   "voided_at" => nil
...> })
%LatticeStripe.Invoice.StatusTransitions{
  finalized_at: 1_700_000_000,
  paid_at: 1_700_000_200,
  marked_uncollectible_at: nil,
  voided_at: nil
}