A postal address: where a buyer lives for the tax (MishkaPay.TaxCalculation), or where a
checkout ships to (MishkaPay.Checkout's :shipping_address). A guarded_struct.
:country: the two-letter ISO 3166-1 code, such as"NL"; the only field a tax calculation needs outside the US.:postal_code: needed for a US address.:line1,:line2,:city,:state(ISO 3166-2 when there is one, such as"CA").:name: the person it goes to, on a shipping address.
Summary
Functions
A sample %MishkaPay.Address{} populated from defaults + type-based fallbacks.
Types
@type t() :: %MishkaPay.Address{ city: String.t() | nil, country: String.t() | nil, line1: String.t() | nil, line2: String.t() | nil, name: String.t() | nil, postal_code: String.t() | nil, state: String.t() | nil }
The struct that builder/1 returns.
| Field | Type | Required | Default | Description | Derives |
|---|---|---|---|---|---|
:country | String.t() | nil | no | sanitize(trim, upcase) validate(string, regex=^[A-Z]{2}$) | ||
:postal_code | String.t() | nil | no | sanitize(trim) validate(string, max_len=20) | ||
:line1 | String.t() | nil | no | sanitize(trim) validate(string, max_len=200) | ||
:line2 | String.t() | nil | no | sanitize(trim) validate(string, max_len=200) | ||
:city | String.t() | nil | no | sanitize(trim) validate(string, max_len=200) | ||
:state | String.t() | nil | no | sanitize(trim) validate(string, max_len=200) | ||
:name | String.t() | nil | no | sanitize(trim) validate(string, max_len=250) |