Monzo.Transaction (monzo_client v1.0.0)

Copy Markdown View Source

A single ledger entry on a Monzo account.

The merchant field is polymorphic on the wire: it's a bare merchant id string unless expanded via expand: [:merchant], in which case it's a full object. This struct always splits that into two separate fields: merchant_id (always present when a merchant exists) and merchant (only populated when expanded).

Summary

Functions

Returns the RFC3339 cursor value used for pagination (the transaction's created timestamp).

Types

decline_reason()

@type decline_reason() ::
  :insufficient_funds
  | :card_inactive
  | :card_blocked
  | :invalid_cvc
  | :other
  | nil

t()

@type t() :: %Monzo.Transaction{
  account_id: String.t() | nil,
  amount: integer(),
  category: String.t() | nil,
  created: DateTime.t() | nil,
  currency: String.t(),
  decline_reason: decline_reason(),
  description: String.t(),
  id: String.t(),
  is_load: boolean(),
  merchant: Monzo.Merchant.t() | nil,
  merchant_id: String.t() | nil,
  metadata: %{optional(String.t()) => String.t()},
  notes: String.t(),
  settled: DateTime.t() | nil
}

Functions

cursor_value(transaction)

@spec cursor_value(t()) :: String.t() | nil

Returns the RFC3339 cursor value used for pagination (the transaction's created timestamp).