View Source StarkInfra.PixChargeback (starkinfra v0.0.1)

Groups PixChargeback related functions

Link to this section Summary

Functions

A Pix chargeback can be created when fraud is detected on a transaction or a system malfunction results in an erroneous transaction. It notifies another participant of your request to reverse the payment they have received. When you initialize a PixChargeback, 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 PixChargeback 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 a PixChargeback in the Stark Infra API

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

Retrieve the PixChargeback 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 stream of PixChargebacks structs previously created in the Stark Infra API

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

Receive a stream of PixChargebacks 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 PixChargeback.

Link to this section Types

@type t() :: %StarkInfra.PixChargeback{
  amount: term(),
  analysis: term(),
  bacen_id: term(),
  created: term(),
  description: term(),
  id: term(),
  reason: term(),
  receiver_bank_code: term(),
  reference_id: term(),
  rejection_reason: term(),
  result: term(),
  reversal_reference_id: term(),
  sender_bank_code: term(),
  status: term(),
  updated: term()
}

Link to this section Functions

Link to this function

%StarkInfra.PixChargeback{}

View Source (struct)

A Pix chargeback can be created when fraud is detected on a transaction or a system malfunction results in an erroneous transaction. It notifies another participant of your request to reverse the payment they have received. When you initialize a PixChargeback, 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):

- `:amount` [integer]: amount in cents to be reversed. ex: 11234 (= R$ 112.34)
- `:reference_id` [string]: end_to_end_id or return_id of the transaction to be reversed. ex: "E20018183202201201450u34sDGd19lz"
- `:reason` [string]: reason why the reversal was requested. Options: "fraud", "flaw", "reversalChargeback"

parameters-optional

Parameters (optional):

- `:description` [string, default nil]: description for the PixChargeback.

attributes-return-only

Attributes (return-only):

- `:id` [string]: unique id returned when the PixChargeback is created. ex: "5656565656565656"
- `:analysis` [string]: analysis that led to the result.
- `:bacen_id` [string]: central bank's unique UUID that identifies the PixChargeback.
- `:sender_bank_code` [string]: bank_code of the Pix participant that created the PixChargeback. ex: "20018183"
- `:receiver_bank_code` [string]: bank_code of the Pix participant that received the PixChargeback. ex: "20018183"
- `:rejection_reason` [string]: reason for the rejection of the Pix chargeback. Options: "noBalance", "accountClosed", "unableToReverse"
- `:reversal_reference_id` [string]: return id of the reversal transaction. ex: "D20018183202202030109X3OoBHG74wo".
- `:result` [string]: result after the analysis of the PixChargeback by the receiving party. Options: "rejected", "accepted", "partiallyAccepted"
- `:status` [string]: current PixChargeback status. Options: "created", "failed", "delivered", "closed", "canceled".
- `:created` [DateTime]: creation datetime for the PixChargeback. ex: ~U[2020-3-10 10:30:0:0]
- `:updated` [DateTime]: latest update datetime for the PixChargeback. 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 PixChargeback 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 PixChargeback struct
Link to this function

create!(chargebacks, options \\ [])

View Source

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

Link to this function

create(chargebacks, options \\ [])

View Source

Create a PixChargeback in the Stark Infra API

parameters-required

Parameters (required):

- `:chargebacks` [list of PixChargeback]: list of PixChargeback 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 PixChargeback structs with updated attributes

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

Retrieve the PixChargeback 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:

- PixChargeback struct that corresponds to the given id.
@spec page!(
  cursor: binary(),
  limit: integer(),
  after: Date.t() | binary(),
  before: Date.t() | binary(),
  status: [binary()],
  ids: [binary()],
  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(),
  limit: integer(),
  after: Date.t() | binary(),
  before: Date.t() | binary(),
  status: [binary()],
  ids: [binary()],
  user: StarkInfra.User.Organization.t() | StarkInfra.User.Project.t() | nil
) :: {:ok, {binary(), [t()]}} | {:error, StarkInfra.Error.t()}

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

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"]
- `: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 PixChargeback structs with updated attributes
- cursor to retrieve the next page of PixChargeback objects
@spec query!(
  limit: integer(),
  after: Date.t() | binary(),
  before: Date.t() | binary(),
  status: [binary()],
  ids: [binary()],
  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(),
  after: Date.t() | binary(),
  before: Date.t() | binary(),
  status: [binary()],
  ids: [binary()],
  user: StarkInfra.User.Organization.t() | StarkInfra.User.Project.t() | nil
) :: {:ok, [t()]} | {:error, StarkInfra.Error.t()}

Receive a stream of PixChargebacks 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"]
- `: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 PixChargeback 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 PixChargeback.

parameters-required

Parameters (required):

- `:id` [string]: PixChargeback id. ex: '5656565656565656'
- `:result` [string]: result after the analysis of the PixChargeback. Options: "rejected", "accepted", "partiallyAccepted".

parameters-conditionally-required

Parameters (conditionally required):

- `rejection_reason` [string, default nil]: if the PixChargeback is rejected a reason is required. Options: "noBalance", "accountClosed", "unableToReverse",
- `reversal_reference_id` [string, default nil]: return_id of the reversal transaction. ex: "D20018183202201201450u34sDGd19lz"

parameters-optional

Parameters (optional):

- `analysis` [string, default nil]: description of the 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:

- PixChargeback with updated attributes