starkbank v2.5.0 StarkBank.TaxPayment View Source

Groups TaxPayment related functions

Link to this section Summary

Functions

When you initialize a TaxPayment, the entity will not be automatically created in the Stark Bank API. The "create" function sends the structs to the Stark Bank API and returns the list of created structs.

Send a list of TaxPayment structs for creation in the Stark Bank API

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

Delete a TaxPayment entity previously created in the Stark Bank API

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

Receive a single TaxPayment 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.

Receive a list of up to 100 TaxPayment structs previously created in the Stark Bank API and the cursor to the next page. Use this function instead of query if you want to manually page your requests.

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

Receive a single Transfer pdf receipt file generated in the Stark Bank API by passing its id. Only valid for transfers with "processing" or "success" status.

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

Receive a stream of TaxPayment entities 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.TaxPayment{
  amount: term(),
  bar_code: term(),
  created: term(),
  description: term(),
  fee: term(),
  id: term(),
  line: term(),
  scheduled: term(),
  status: term(),
  tags: term(),
  type: term(),
  updated: term()
}

Link to this section Functions

Link to this function

%StarkBank.TaxPayment{}

View Source (struct)

When you initialize a TaxPayment, the entity will not be automatically created in the Stark Bank API. The "create" function sends the structs to the Stark Bank API and returns the list of created structs.

Parameters (conditionally required):

  • :line [string, default nil]: Number sequence that describes the payment. Either "line" or "bar_code" parameters are required. If both are sent, they must match. ex: "34191.09008 63571.277308 71444.640008 5 81960000000062"
  • :bar_code [string, default nil]: Bar code number that describes the payment. Either "line" or "bar_code" parameters are required. If both are sent, they must match. ex: "34195819600000000621090063571277307144464000"

Parameters (required):

  • :description [string]: Text to be displayed in your statement (min. 10 characters). ex: "payment ABC"

Parameters (optional):

  • :scheduled [string, default today]: payment scheduled date. ex: "2020-03-10"
  • :tags [list of strings]: list of strings for tagging

Attributes (return-only):

  • :id [string, default nil]: unique id returned when payment is created. ex: "5656565656565656"
  • :type [string, default nil]: tax type. ex: "das"
  • :status [string, default nil]: current payment status. ex: "success" or "failed"
  • :amount [int, default nil]: amount automatically calculated from line or bar_code. ex: 23456 (= R$ 234.56)
  • :fee [integer, default nil]: fee charged when the tax payment is created. ex: 200 (= R$ 2.00)
  • :updated [string, default nil]: latest update datetime for the payment. ex: "2020-03-10 10:30:00.000"
  • :created [string, default nil]: creation datetime for the payment. ex: "2020-03-10 10:30:00.000"
Link to this function

create(payments, options \\ [])

View Source
create([t() | map()], [
  {:user, StarkBank.User.Project.t() | StarkBank.User.Organization.t() | nil}
]) :: {:ok, [t()]} | {:error, [StarkBank.Error.t()]}

Send a list of TaxPayment structs for creation in the Stark Bank API

Parameters (required):

  • :payments [list of TaxPayment structs]: list of TaxPayment structs to be created in the API

Options:

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

Return:

  • list of TaxPayment structs with updated attributes
Link to this function

create!(payments, options \\ [])

View Source
create!([t() | map()], [
  {:user, StarkBank.User.Project.t() | StarkBank.User.Organization.t() | nil}
]) :: any()

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

Link to this function

delete(id, options \\ [])

View Source
delete(binary(), [
  {:user, StarkBank.User.Project.t() | StarkBank.User.Organization.t() | nil}
]) :: {:ok, t()} | {:error, [%StarkBank.Error{code: term(), message: term()}]}

Delete a TaxPayment entity previously created in the Stark Bank API

Parameters (required):

  • :id [string]: Boleto unique id. ex: "5656565656565656"

Options:

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

Return:

  • deleted TaxPayment struct
Link to this function

delete!(id, options \\ [])

View Source
delete!(binary(), [
  {:user, StarkBank.User.Project.t() | StarkBank.User.Organization.t() | nil}
]) :: t()

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

Link to this function

get(id, options \\ [])

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

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

Parameters (required):

  • :id [string]: entity unique id. ex: "5656565656565656"

Options:

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

Return:

  • TaxPayment struct with updated attributes
Link to this function

get!(id, options \\ [])

View Source
get!(binary(), [
  {:user, StarkBank.User.Project.t() | StarkBank.User.Organization.t() | nil}
]) :: t()

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

Link to this function

page(options \\ [])

View Source
page(
  cursor: binary(),
  limit: integer(),
  after: Date.t() | binary(),
  before: Date.t() | binary(),
  tags: [binary()],
  ids: [binary()],
  status: binary(),
  user: StarkBank.User.Project.t() | StarkBank.User.Organization.t()
) ::
  {:ok, {binary(), [t()]}}
  | {:error, [%StarkBank.Error{code: term(), message: term()}]}

Receive a list of up to 100 TaxPayment structs previously created in the Stark Bank API and the cursor to the next page. Use this function instead of query if you want to manually page your requests.

Options:

  • :cursor [string, default nil]: cursor returned on the previous page function call
  • :limit [integer, default nil]: maximum number of entities to be retrieved. Unlimited if nil. ex: 35
  • :after [Date or string, default nil]: date filter for entities created only after specified date. ex: ~D[2020-03-25]
  • :before [Date or string, default nil]: date filter for entities created only before specified date. ex: ~D[2020-03-25]
  • :tags [list of strings, default nil]: tags to filter retrieved structs. ex: ["tony", "stark"]
  • :ids [list of strings, default nil]: list of ids to filter retrieved structs. ex: ['5656565656565656', '4545454545454545']
  • :status [string, default nil]: filter for status of retrieved structs. ex: 'success'
  • :user [Organization/Project, default nil]: Organization or Project struct returned from StarkBank.project(). Only necessary if default project or organization has not been set in configs.

Return:

  • list of TaxPayment structs with updated attributes and cursor to retrieve the next page of TaxPayment structs
Link to this function

page!(options \\ [])

View Source
page!(
  cursor: binary(),
  limit: integer(),
  after: Date.t() | binary(),
  before: Date.t() | binary(),
  tags: [binary()],
  ids: [binary()],
  status: binary(),
  user: StarkBank.User.Project.t() | StarkBank.User.Organization.t()
) :: [t()]

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

Link to this function

pdf(id, options \\ [])

View Source
pdf(binary(), [
  {:user, StarkBank.User.Project.t() | StarkBank.User.Organization.t() | nil}
]) ::
  {:ok, binary()} | {:error, [%StarkBank.Error{code: term(), message: term()}]}

Receive a single Transfer pdf receipt file generated in the Stark Bank API by passing its id. Only valid for transfers with "processing" or "success" status.

Parameters (required):

  • id [string]: struct unique id. ex: "5656565656565656"

Options:

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

Return:

  • Transfer pdf file content
Link to this function

pdf!(id, options \\ [])

View Source
pdf!(binary(), [
  {:user, StarkBank.User.Project.t() | StarkBank.User.Organization.t() | nil}
]) :: binary()

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

Link to this function

query(options \\ [])

View Source
query(
  limit: integer(),
  after: Date.t() | binary(),
  before: Date.t() | binary(),
  tags: [binary()],
  ids: [binary()],
  status: binary(),
  user: StarkBank.User.Project.t() | StarkBank.User.Organization.t()
) ::
  ({:cont, {:ok, [t()]}}
   | {:error, [StarkBank.Error.t()]}
   | {:halt, any()}
   | {:suspend, any()},
   any() ->
     any())

Receive a stream of TaxPayment entities previously created in the Stark Bank API

Options:

  • :limit [integer, default nil]: maximum number of entities to be retrieved. Unlimited if nil. ex: 35
  • :after [Date or string, default nil]: date filter for entities created only after specified date. ex: ~D[2020-03-25]
  • :before [Date or string, default nil]: date filter for entities created only before specified date. ex: ~D[2020-03-25]
  • :tags [list of strings, default nil]: tags to filter retrieved structs. ex: ["tony", "stark"]
  • :ids [list of strings, default nil]: list of ids to filter retrieved structs. ex: ['5656565656565656', '4545454545454545']
  • :status [string, default nil]: filter for status of retrieved structs. ex: 'success'
  • :user [Organization/Project, default nil]: Organization or Project struct returned from StarkBank.project(). Only necessary if default project or organization has not been set in configs.

Return:

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

query!(options \\ [])

View Source
query!(
  limit: integer(),
  after: Date.t() | binary(),
  before: Date.t() | binary(),
  tags: [binary()],
  ids: [binary()],
  status: binary(),
  user: StarkBank.User.Project.t() | StarkBank.User.Organization.t()
) :: ({:cont, [t()]} | {:halt, any()} | {:suspend, any()}, any() -> any())

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