starkbank v0.0.2 StarkBank.BoletoPayment.Log View Source

Groups BoletoPayment.Log related functions

BoletoPayment.Log struct:

Every time a BoletoPayment entity is modified, a corresponding BoletoPayment.Log is generated for the entity. This log is never generated by the user, but it can be retrieved to check additional information on the BoletoPayment.

Attributes:

  • id [string]: unique id returned when the log is created. ex: "5656565656565656"
  • payment [BoletoPayment]: BoletoPayment entity to which the log refers to.
  • errors [list of strings]: list of errors linked to this BoletoPayment event.
  • type [string]: type of the BoletoPayment event which triggered the log creation. ex: "registered" or "paid"
  • created [DateTime]: creation datetime for the payment. ex: ~U[2020-03-26 19:32:35.418698Z]

Link to this section Summary

Functions

Retrieve a specific Log

Receive a single Log struct previously created by the Stark Bank API by passing its id

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

Retrieve Logs

Receive a stream of Log structs previously created in the Stark Bank API

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

Link to this section Types

Link to this type

t()

View Source
t() :: %StarkBank.BoletoPayment.Log{
  created: term(),
  errors: term(),
  id: term(),
  payment: term(),
  type: term()
}

Link to this section Functions

Link to this function

get(user, id)

View Source
get(StarkBank.User.Project.t(), binary()) ::
  {:ok, StarkBank.BoletoPayment.Log.t()}
  | {:error, [%StarkBank.Error{code: term(), message: term()}]}

Retrieve a specific Log

Receive a single Log struct previously created by the Stark Bank API by passing its id

Parameters (required):

  • user [Project]: Project struct returned from StarkBank.project().
  • id [string]: struct unique id. ex: "5656565656565656"

Return:

  • Log struct with updated attributes
Link to this function

get!(user, id)

View Source
get!(StarkBank.User.Project.t(), binary()) :: StarkBank.BoletoPayment.Log.t()

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

Link to this function

query(user, options \\ [])

View Source
query(StarkBank.User.Project.t(), any()) ::
  ({:cont, {:ok, [StarkBank.BoletoPayment.Log.t()]}}
   | {:error, [StarkBank.Error.t()]}
   | {:halt, any()}
   | {:suspend, any()},
   any() ->
     any())

Retrieve Logs

Receive a stream of Log structs previously created in the Stark Bank API

Parameters (required):

  • user [Project]: Project struct returned from StarkBank.project().

Parameters (optional):

  • limit [integer, default nil]: maximum number of entities to be retrieved. Unlimited if nil. ex: 35
  • after [Date, default nil] date filter for entities created only after specified date. ex: Date(2020, 3, 10)
  • before [Date, default nil] date filter for entities only before specified date. ex: Date(2020, 3, 10)
  • payment_ids [list of strings, default nil]: list of BoletoPayment ids to filter retrieved entities. ex: ["5656565656565656", "4545454545454545"]
  • types [list of strings, default nil]: filter retrieved entities by event types. ex: "paid" or "registered"

Return:

  • stream of Log structs with updated attributes
Link to this function

query!(user, options \\ [])

View Source
query!(StarkBank.User.Project.t(), any()) ::
  ({:cont, [StarkBank.BoletoPayment.Log.t()]}
   | {:halt, any()}
   | {:suspend, any()},
   any() ->
     any())

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