View Source StarkInfra.PixInfraction (starkinfra v0.0.1)

Groups PixInfraction related functions

Link to this section Summary

Functions

PixInfraction are used to report transactions that are suspected of fraud, to request a refund or to reverse a refund. When you initialize a PixInfraction, the entity will not be automatically created in the Stark Infra API. The 'create' function sends the objects to the Stark Infra API and returns the created struct.

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

Cancel a PixInfraction entity previously created in the Stark Infra API

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

Create PixInfractions in the Stark Infra API

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

Retrieve the PixInfraction struct linked to your Workspace in the Stark Infra API using its id.

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

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

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

Receive a stream of PixInfractions structs previously created in the Stark Infra API

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

Respond to a received PixInfraction.

Link to this section Types

@type t() :: %StarkInfra.PixInfraction{
  agent: term(),
  analysis: term(),
  bacen_id: term(),
  created: term(),
  credited_bank_code: term(),
  debited_bank_code: term(),
  description: term(),
  id: term(),
  reference_id: term(),
  reported_by: term(),
  result: term(),
  status: term(),
  type: term(),
  updated: term()
}

Link to this section Functions

Link to this function

%StarkInfra.PixInfraction{}

View Source (struct)

PixInfraction are used to report transactions that are suspected of fraud, to request a refund or to reverse a refund. When you initialize a PixInfraction, the entity will not be automatically created in the Stark Infra API. The 'create' function sends the objects to the Stark Infra API and returns the created struct.

parameters-required

Parameters (required):

- `:reference_id` [string]: end_to_end_id or return_id of the transaction being reported. ex: "E20018183202201201450u34sDGd19lz"
- `:type` [string]: type of infraction report. Options: "fraud", "reversal", "reversalChargeback"

parameters-optional

Parameters (optional):

- `:description` [string, default nil]: description for any details that can help with the infraction investigation.

attributes-return-only

Attributes (return-only):

- id [string]: unique id returned when the PixInfraction is created. ex: "5656565656565656"
- credited_bank_code [string]: bank_code of the credited Pix participant in the reported transaction. ex: "20018183"
- debited_bank_code [string]: bank_code of the debited Pix participant in the reported transaction. ex: "20018183"
- agent [string]: Options: "reporter" if you created the PixInfraction, "reported" if you received the PixInfraction.
- analysis [string]: analysis that led to the result.
- bacen_id [string]: central bank's unique UUID that identifies the infraction report.
- reported_by [string]: agent that reported the PixInfraction. Options: "debited", "credited".
- result [string]: result after the analysis of the PixInfraction by the receiving party. Options: "agreed", "disagreed"
- status [string]: current PixInfraction status. Options: "created", "failed", "delivered", "closed", "canceled".
- created [DateTime]: creation datetime for the PixInfraction. ex: ~U[2020-3-10 10:30:0:0]
- updated [DateTime]: latest update datetime for the PixInfraction. ex: ~U[2020-3-10 10:30:0:0]
Link to this function

cancel!(id, options \\ [])

View Source

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

Link to this function

cancel(id, options \\ [])

View Source

Cancel a PixInfraction entity previously created in the Stark Infra API

parameters-required

Parameters (required):

- `:id` [string]: struct unique id. ex: "5656565656565656"

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:

- canceled PixInfraction struct
Link to this function

create!(infractions, options \\ [])

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

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

Link to this function

create(infractions, options \\ [])

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

Create PixInfractions in the Stark Infra API

parameters-required

Parameters (required):

- `:infractions` [list of PixInfraction]: list of PixInfraction structs to be created in the 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 PixInfraction structs with updated attributes

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

Retrieve the PixInfraction struct linked to your Workspace in the Stark Infra API using its id.

parameters-required

Parameters (required):

- `:id` [string]: struct unique id. ex: "5656565656565656".

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:

- PixInfraction struct that corresponds to the given id.
@spec page!(
  cursor: binary() | nil,
  limit: integer() | nil,
  after: Date.t() | binary() | nil,
  before: Date.t() | binary() | nil,
  status: [binary()] | nil,
  ids: [binary()] | nil,
  type: [binary()] | nil,
  user: StarkInfra.User.Organization.t() | StarkInfra.User.Project.t() | nil
) :: any()

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

@spec page(
  cursor: binary() | nil,
  limit: integer() | nil,
  after: Date.t() | binary() | nil,
  before: Date.t() | binary() | nil,
  status: [binary()] | nil,
  ids: [binary()] | nil,
  type: [binary()] | nil,
  user: StarkInfra.User.Organization.t() | StarkInfra.User.Project.t() | nil
) :: {:ok, {binary(), [t() | map()]}} | {:error, StarkInfra.Error.t()}

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

options

Options:

- `:cursor` [string, default nil]: cursor returned on the previous page function call.
- `:limit` [integer, default 100]: maximum number of structs to be retrieved. Max = 100. ex: 35
- `:after` [Date or string, default nil]: date filter for structs created after a specified date. ex: ~D[2020-03-10]
- `:before` [Date or string, default nil]: date filter for structs created before a specified date. ex: ~D[2020-03-10]
- `:status` [list of strings, default nil]: filter for status of retrieved objects. ex: ["created", "failed", "delivered", "closed", "canceled"]
- `:ids` [list of strings, default nil]: list of ids to filter retrieved objects. ex: ["5656565656565656", "4545454545454545"]
- `:type` [list of strings, default nil]: filter for the type of retrieved PixInfractions. Options: "fraud", "reversal", "reversalChargeback"
- `: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 PixInfraction structs with updated attributes and cursor to retrieve the next page of PixInfraction objects
@spec query!(
  limit: integer() | nil,
  after: Date.t() | binary() | nil,
  before: Date.t() | binary() | nil,
  status: [binary()] | nil,
  ids: [binary()] | nil,
  type: [binary()] | nil,
  user: StarkInfra.User.Organization.t() | StarkInfra.User.Project.t() | nil
) :: any()

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

@spec query(
  limit: integer() | nil,
  after: Date.t() | binary() | nil,
  before: Date.t() | binary() | nil,
  status: [binary()] | nil,
  ids: [binary()] | nil,
  type: [binary()] | nil,
  user: StarkInfra.User.Organization.t() | StarkInfra.User.Project.t() | nil
) ::
  ({:cont, {:ok, [t() | map()]}}
   | {:error, [StarkInfra.Error.t()]}
   | {:halt, any()}
   | {:suspend, any()},
   any() ->
     any())

Receive a stream of PixInfractions structs previously created in the Stark Infra API

options

Options:

- `:limit` [integer, default 100]: maximum number of structs to be retrieved. Max = 100. ex: 35
- `:after` [Date or string, default nil]: date filter for structs created after a specified date. ex: ~D[2020-03-10]
- `:before` [Date or string, default nil]: date filter for structs created before a specified date. ex: ~D[2020-03-10]
- `:status` [list of strings, default nil]: filter for status of retrieved objects. ex: ["created", "failed", "delivered", "closed", "canceled"]
- `:ids` [list of strings, default nil]: list of ids to filter retrieved objects. ex: ["5656565656565656", "4545454545454545"]
- `:type` [list of strings, default nil]: filter for the type of retrieved PixInfractions. Options: "fraud", "reversal", "reversalChargeback"
- `: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:

- stream of PixInfraction structs with updated attributes
Link to this function

update!(id, result, parameters \\ [])

View Source

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

Link to this function

update(id, result, parameters \\ [])

View Source

Respond to a received PixInfraction.

parameters-required

Parameters (required):

- `:id` [string]: PixInfraction id. ex: '5656565656565656'
- `:result` [string]: result after the analysis of the PixInfraction. Options: "agreed", "disagreed"

parameters-optional

Parameters (optional):

- `:analysis` [string, default nil]: analysis that led to the result.
- `: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:

- PixInfraction with updated attributes