View Source StarkInfra.PixBalance (starkinfra v0.1.0)

Groups PixBalance related functions

Link to this section Summary

Functions

The PixBalance struct displays the current balance of the Workspace, which is the result of the sum of all transactions within this Workspace. The balance is never generated by the user, but it can be retrieved to see the available information.

Same as get(), but it will unwrap the error tuple and raise in case of errors.

Receive the PixBalance struct linked to your Workspace in the Stark Infra API

Link to this section Types

@type t() :: %StarkInfra.PixBalance{
  amount: term(),
  currency: term(),
  id: term(),
  updated: term()
}

Link to this section Functions

Link to this function

%StarkInfra.PixBalance{}

View Source (struct)

The PixBalance struct displays the current balance of the Workspace, which is the result of the sum of all transactions within this Workspace. The balance is never generated by the user, but it can be retrieved to see the available information.

attributes-return-only

Attributes (return-only):

  • :id [string]: unique id returned when Balance is created. ex: "5656565656565656"
  • :amount [integer]: current balance amount of the Workspace in cents. ex: 200 (= R$ 2.00)
  • :currency [string]: currency of the current Workspace. Expect others to be added eventually. ex: "BRL"
  • :updated [DateTime]: latest update DateTime for the PixBalance. ex: ~U[2020-3-10 10:30:0:0]
@spec get!([
  {:user, StarkInfra.User.Project.t() | StarkInfra.User.Organization.t() | nil}
]) :: any()

Same as get(), but it will unwrap the error tuple and raise in case of errors.

@spec get([
  {:user, StarkInfra.User.Project.t() | StarkInfra.User.Organization.t() | nil}
]) ::
  {:ok, t()} | {:error, [{:error, StarkInfra.Error.t()}]}

Receive the PixBalance struct linked to your Workspace in the Stark Infra API

options

Options:

  • :user [Organization/Project, default nil]: Organization or Project struct returned from StarkInfra.project(). Only necessary if default project or organization has not been set in configs.

return

Return:

  • list of PixBalance struct with updated attributes