Omise.Search (omise v0.10.0)

Provides Search API interfaces.

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

Summary

Types

@type t() :: %Omise.Search{
  data: list(),
  export: String.t(),
  filters: map(),
  location: String.t(),
  object: String.t(),
  order: String.t(),
  page: integer(),
  per_page: integer(),
  query: String.t(),
  scope: String.t(),
  total: integer(),
  total_pages: integer()
}

Functions

Link to this function

execute(scope, params, opts \\ [])

@spec execute(String.t(), Keyword.t(), Keyword.t()) ::
  {:ok, t()} | {:error, Omise.Error.t()}

Retrieve a search data.

Query Parameters:

  • order - (optional, default: chronological) The order of the list returned. I.e.: chronological (from earliest to latest), reverse_chronological (from latest to earliest).
  • scope - A scope you are searching for I.e. charge, dispute, recipient, and customer.
  • query - Searching text within the scope, see more in availble search fields.
  • filters - Searching text with specific key within the scope, see more in list of filter keys.
  • page - (optional, default: 1) Specific number of searching page.

Examples

Omise.Search.execute("charge",
  order: "reverse_chronological",
  query: "Elixir",
  filters: [captured: true, amount: 1000]
)

Omise.Search.execute("customer",
  query: "Elm",
  filters: [created: "2016-03-15"]
)