LatticeStripe.ExternalAccount.Unknown (LatticeStripe v1.1.0)

Copy Markdown View Source

Forward-compatibility fallback for LatticeStripe.ExternalAccount responses whose object is neither "bank_account" nor "card". Preserves the raw payload in :extra so user code does not crash on a new Stripe object type.

Callers should match %LatticeStripe.BankAccount{} or %LatticeStripe.Card{} first and treat %LatticeStripe.ExternalAccount.Unknown{} as an escape hatch:

case ea do
  %LatticeStripe.BankAccount{} -> handle_bank(ea)
  %LatticeStripe.Card{} -> handle_card(ea)
  %LatticeStripe.ExternalAccount.Unknown{} = u ->
    Logger.warning("unknown external account type: #{u.object}")
end

Summary

Types

t()

@type t() :: %LatticeStripe.ExternalAccount.Unknown{
  extra: map(),
  id: String.t() | nil,
  object: String.t() | nil
}