Runtime configuration for the Worldpay client.
Application config
config :worldpay,
username: "your-username",
password: "your-password",
environment: :try,
api_version: "2025-01-01",
wpg_merchant_code: "MYMERCHANT",
wpg_username: "wpg-user",
wpg_password: "wpg-pass",
timeout: 30_000,
retry_count: 3,
circuit_breaker: trueEnvironment variable overrides (take precedence)
WORLDPAY_USERNAMEWORLDPAY_PASSWORDWORLDPAY_ENVIRONMENT—"try"or"live"WORLDPAY_API_VERSIONWORLDPAY_WPG_MERCHANT_CODEWORLDPAY_WPG_USERNAMEWORLDPAY_WPG_PASSWORD
Summary
Types
@type environment() :: :try | :live
@type t() :: %Worldpay.Config{ api_version: String.t(), base_url: String.t(), circuit_breaker: boolean(), environment: environment(), password: String.t() | nil, retry_count: non_neg_integer(), timeout: non_neg_integer(), username: String.t() | nil, wpg_base_url: String.t(), wpg_merchant_code: String.t() | nil, wpg_password: String.t() | nil, wpg_username: String.t() | nil }
Functions
Encode Basic Auth header value for Access APIs.
@spec default_access_url() :: String.t()
Default Access API base URL (try environment).
@spec default_wpg_url() :: String.t()
Default WPG base URL (try environment).
Build a Config from application env and environment variables.
Environment variables take precedence over application config.
The overrides keyword list takes the highest precedence.
Encode Basic Auth header value for WPG.