DodoPayments (dodo_payments v0.1.0)

Copy Markdown View Source

Req-first Elixir SDK for Dodo Payments.

Construct an explicit DodoPayments.Client and pass it as the first argument to Dodo-named resource modules such as DodoPayments.CheckoutSessions, DodoPayments.Payments, and DodoPayments.Subscriptions.

client =
  DodoPayments.client!(
    environment: :test,
    api_key: System.fetch_env!("DODO_PAYMENTS_API_KEY")
  )

DodoPayments.Products.list(client)

No application-global API key or SDK-owned process is required.

Summary

Functions

Number of classified merchant/public HTTP operations in this SDK.

Version of the audited official Dodo Payments SDK source surface.

Returns successful data or raises the returned SDK exception.

HTTP user-agent emitted by this SDK release.

Version of this Elixir SDK release.

Types

json()

@type json() ::
  nil
  | boolean()
  | number()
  | String.t()
  | [json()]
  | %{optional(String.t()) => json()}

Functions

client(options \\ [])

@spec client(keyword()) ::
  {:ok, DodoPayments.Client.t()}
  | {:error, DodoPayments.Error.ConfigurationError.t()}

Delegates to DodoPayments.Client.new/1.

client!(options \\ [])

@spec client!(keyword()) :: DodoPayments.Client.t()

Delegates to DodoPayments.Client.new!/1.

operation_count()

@spec operation_count() :: pos_integer()

Number of classified merchant/public HTTP operations in this SDK.

source_sdk_version()

@spec source_sdk_version() :: String.t()

Version of the audited official Dodo Payments SDK source surface.

unwrap!(arg)

@spec unwrap!({:ok, value} | {:error, Exception.t()}) :: value when value: term()

Returns successful data or raises the returned SDK exception.

iex> DodoPayments.unwrap!({:ok, :paid})
:paid

user_agent()

@spec user_agent() :: String.t()

HTTP user-agent emitted by this SDK release.

version()

@spec version() :: String.t()

Version of this Elixir SDK release.