GoCardlessClient.Resources.Balances (GoCardlessClient v2.0.0)

Copy Markdown View Source

GoCardless Balances API.

Returns balance information for the Payment Account(s) associated with your creditor. Balances are read-only — there is no create or update endpoint.

Example

{:ok, %{items: balances}} = GoCardlessClient.Resources.Balances.list(client)
Enum.each(balances, fn b ->
  IO.puts("#{b["currency"]}: #{b["amount"]}")
end)

Summary

Functions

Eagerly collects all balances into a list.

Returns a page of balances. Accepts optional filter params.

Returns a lazy Stream over all pages of balances.

Functions

collect_all(client, params \\ %{}, opts \\ [])

@spec collect_all(GoCardlessClient.Client.t(), map(), keyword()) ::
  {:ok, [map()]}
  | {:error, GoCardlessClient.APIError.t() | GoCardlessClient.Error.t()}

Eagerly collects all balances into a list.

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

@spec list(GoCardlessClient.Client.t(), map(), keyword()) ::
  {:ok, %{items: [map()], meta: map()}}
  | {:error, GoCardlessClient.APIError.t() | GoCardlessClient.Error.t()}

Returns a page of balances. Accepts optional filter params.

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

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

Returns a lazy Stream over all pages of balances.