ClearBank.Config (ClearBank v1.0.0)

Copy Markdown View Source

Configuration management for clearbank.

Reads from Application.get_env/2 and validates with NimbleOptions.

Summary

Functions

Returns the base URL for the given environment.

Builds the default ClearBank.Client from application config.

Validates and returns application config as a keyword list. Raises NimbleOptions.ValidationError on invalid config.

Resolves the private key binary from either :private_key or :private_key_path.

Returns the NimbleOptions schema for introspection and documentation.

Functions

base_url(atom)

@spec base_url(:simulation | :production) :: String.t()

Returns the base URL for the given environment.

default_client()

@spec default_client() :: ClearBank.Client.t()

Builds the default ClearBank.Client from application config.

fetch!()

@spec fetch!() :: keyword()

Validates and returns application config as a keyword list. Raises NimbleOptions.ValidationError on invalid config.

resolve_private_key(opts)

@spec resolve_private_key(keyword()) :: binary() | nil

Resolves the private key binary from either :private_key or :private_key_path.

schema()

@spec schema() :: NimbleOptions.t()

Returns the NimbleOptions schema for introspection and documentation.