MishkaPay.Checkout.Fields (Mishka Pay v0.0.1)

Copy Markdown View Source

Summary

Types

t()

The struct that builder/1 returns.

Functions

A sample %MishkaPay.Checkout.Fields{} populated from defaults + type-based fallbacks.

Types

t()

@type t() :: %MishkaPay.Checkout.Fields{
  key: String.t(),
  label: String.t(),
  optional: boolean() | nil,
  options: [MishkaPay.Checkout.Fields.Options.t()] | nil,
  type: (:text | :numeric | :dropdown) | nil
}

The struct that builder/1 returns.

FieldTypeRequiredDefaultDescriptionDerives
:keyString.t()yessanitize(trim) validate(not_nil_value, string, not_empty, max_len=200, regex=\A[A-Za-z0-9]+\z)
:labelString.t()yessanitize(trim) validate(not_nil_value, string, not_empty, max_len=50)
:type:text | :numeric | :dropdown | nilno:textvalidate(not_nil_value, enum=Atom[text::numeric::dropdown])<br>validator {MishkaPay.Checkout, :field_type}
:optionalboolean() | nilnofalsevalidate(boolean)
:options[MishkaPay.Checkout.Fields.Options.t()] | nilnovalidate(list, max_len=200)

Functions

builder(attrs_or_input, error \\ false)

enforce_keys()

enforce_keys(field)

example()

A sample %MishkaPay.Checkout.Fields{} populated from defaults + type-based fallbacks.

keys()

keys(field)