Paddle.Config (paddlex v0.2.0)

Copy Markdown View Source

Resolves library configuration.

Configuration is read from the :paddlex application environment and can be overridden per call via the opts keyword list accepted by every API function:

config :paddlex,
  vendor_id: 12345,
  vendor_auth_code: "...",
  environment: :sandbox # or :production (default)

Supported keys:

  • :vendor_id - your Paddle vendor id
  • :vendor_auth_code - your Paddle API auth code
  • :environment - :production (default) or :sandbox
  • :vendors_base_url - overrides the vendors API base URL
  • :checkout_base_url - overrides the checkout API base URL

Summary

Functions

Resolves the effective configuration, merging per-call overrides over the application environment. Keys other than the supported ones are ignored.

Types

t()

@type t() :: %{
  vendor_id: integer() | String.t() | nil,
  vendor_auth_code: String.t() | nil,
  environment: atom(),
  vendors_base_url: String.t(),
  checkout_base_url: String.t()
}

Functions

resolve(overrides \\ [])

@spec resolve(keyword()) :: t()

Resolves the effective configuration, merging per-call overrides over the application environment. Keys other than the supported ones are ignored.