Payzum.Config (Payzum v0.1.0)

Copy Markdown View Source

Client configuration, validated once at construction.

Summary

Types

t()

@type t() :: %Payzum.Config{
  api_key: String.t(),
  base_url: String.t(),
  max_retries: non_neg_integer(),
  timeout: pos_integer()
}

Functions

new(api_key, opts \\ [])

@spec new(String.t(), keyword()) ::
  {:ok, t()} | {:error, Payzum.Errors.Validation.t()}

Build a configuration.

The API key check mirrors the server: at least 32 characters and nothing else, because being stricter here would reject keys the API accepts.

production()

sandbox()