Omise.Link (omise v0.10.0)

Provides Link API interfaces.

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

Summary

Types

@type t() :: %Omise.Link{
  amount: integer(),
  charges: Omise.List.t(),
  created: String.t(),
  currency: String.t(),
  description: String.t(),
  id: String.t(),
  livemode: boolean(),
  location: String.t(),
  multiple: boolean(),
  object: String.t(),
  payment_uri: String.t(),
  title: String.t(),
  used: boolean()
}

Functions

Link to this function

create(params \\ [], opts \\ [])

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

Create a link.

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

Examples

# For one time use
Omise.Link.create(
  amount: 1000_00,
  currency: "thb",
  title: "Awesome Elixir",
  description: "This book will teach you about Elixir Programming Language"
)

# For multiple time use
Omise.Link.create(
  amount: 1000_00,
  currency: "thb",
  title: "Awesome Elixir",
  description: "This book will teach you about Elixir Programming Language"
  multiple: true
)
Link to this function

list(params \\ [], opts \\ [])

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

List all links.

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

Examples

Omise.Link.list

Omise.Link.list(limit: 10, order: "reverse_chronological")
Link to this function

retrieve(id, opts \\ [])

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

Retrieve a link.

Examples

Omise.Link.retrieve("link_test_55s7oubg54yln9ey2h4")