Marqeta.DiVA.Authorizations (marqeta v1.0.0)

Copy Markdown View Source

All authorization attempts (approvals and declines).

Key fields: transaction_token, card_token, user_token, amount, currency_code, merchant_name, mcc, network, response_code, stan, rrn, auth_code, pos_type, card_presence, pin_present, is_recurring, is_installment, country_code, created_time.

Summary

Functions

Returns the data dictionary (field definitions) for this DiVA view.

Lists authorization records.

Lists authorization records. Raises on error.

Returns a lazy Stream over all authorization records, auto-paginating.

Functions

data_dictionary(opts \\ [])

@spec data_dictionary(keyword()) :: {:ok, map()} | {:error, Marqeta.Error.t()}

Returns the data dictionary (field definitions) for this DiVA view.

list(params \\ %{}, opts \\ [])

@spec list(
  map(),
  keyword()
) :: {:ok, map()} | {:error, Marqeta.Error.t()}

Lists authorization records.

Parameters

  • params — Query params: start_date, end_date, count, start_index, sort_by, sort_order, fields.
  • opts — Per-request overrides.

list!(params \\ %{}, opts \\ [])

@spec list!(
  map(),
  keyword()
) :: map()

Lists authorization records. Raises on error.

stream(params \\ %{}, opts \\ [])

@spec stream(
  map(),
  keyword()
) :: Enumerable.t()

Returns a lazy Stream over all authorization records, auto-paginating.

Example

Marqeta.DiVA.Authorizations.stream(%{start_date: "2024-01-01"})
|> Stream.filter(& &1["response_code"] == "00")
|> Enum.count()