Shared client-side validation helpers used by all Setu SDK modules.
All functions return :ok on success or {:error, %SetuClient.Error{type: :validation}}.
Summary
Functions
Returns :ok when id is a non-empty binary.
Returns :ok when id is a non-empty binary (alias for readability).
Returns :ok when params[key] is a non-empty binary.
Returns :ok when val is a positive integer.
Functions
@spec require_id(term(), String.t()) :: :ok | {:error, SetuClient.Error.t()}
Returns :ok when id is a non-empty binary.
@spec require_merchant(term()) :: :ok | {:error, SetuClient.Error.t()}
Returns :ok when id is a non-empty binary (alias for readability).
@spec require_param(map(), atom()) :: :ok | {:error, SetuClient.Error.t()}
Returns :ok when params[key] is a non-empty binary.
@spec require_positive(term(), String.t()) :: :ok | {:error, SetuClient.Error.t()}
Returns :ok when val is a positive integer.