omise v0.3.0 Omise.Dispute

Provides Dispute API interfaces.

https://www.omise.co/disputes-api

Summary

Functions

List all disputes

Retrieve a dispute

Update a dispute

Types

t :: %Omise.Dispute{amount: Integer.t, charge: String.t, created: String.t, currency: String.t, id: String.t, livemode: boolean, location: String.t, message: String.t, object: String.t, status: String.t}

Functions

list(params \\ [])

Specs

list(Keyword.t) ::
  {:ok, Omise.List.t} |
  {:error, Omise.Error.t}

List all disputes.

Returns {:ok, disputes} if the request is successful, {:error, error} otherwise.

Query Parameters:

  • offset - (optional, default: 0) The offset of the first record returned.
  • limit - (optional, default: 20, maximum: 100) The maximum amount of records returned.
  • from - (optional, default: 1970-01-01T00:00:00Z, format: ISO 8601) The UTC date and time limiting the beginning of returned records.
  • to - (optional, default: current UTC Datetime, format: ISO 8601) The UTC date and time limiting the end of returned records.

Examples

# List all disputes
Omise.Dispute.list

# List all open disputes
Omise.Dispute.list(status: "open")

# List all pending disputes
Omise.Dispute.list(status: "pending")

# List all closed disputes
Omise.Dispute.list(status: "closed")
retrieve(id)

Specs

retrieve(String.t) ::
  {:ok, Omise.Dispute.t} |
  {:error, Omise.Error.t}

Retrieve a dispute.

Returns {:ok, dispute} if the request is successful, {:error, error} otherwise.

Examples

Omise.Dispute.retrieve("dspt_test_51yfnnpsxajeybpytm4")
update(id, params)

Specs

update(String.t, Keyword.t) ::
  {:ok, Omise.Dispute.t} |
  {:error, Omise.Error.t}

Update a dispute.

Returns {:ok, dispute} if the request is successful, {:error, error} otherwise.

Request Parameter:

  • message - The new dispute message.

Examples

Omise.Dispute.update("dspt_test_4zgf15h89w8t775kcm8", message: "Shut up and dance with me!")