LatticeStripe.Tax.ShippingCost (LatticeStripe v2.0.0)

Copy Markdown View Source

The shipping_cost object embedded in a Stripe Tax calculation or transaction.

Reachable from LatticeStripe.Tax.Calculation.t/0 and LatticeStripe.Tax.Transaction.t/0. Carries the shipping amount alongside its own tax_breakdown, because shipping is taxed separately from line items in most jurisdictions.

Embedded value struct: fields are additive. Keys Stripe adds later appear under :extra rather than being dropped, so a new field never breaks decoding.

Summary

Types

t()

@type t() :: %LatticeStripe.Tax.ShippingCost{
  amount: integer() | nil,
  amount_tax: integer() | nil,
  extra: map(),
  shipping_rate: String.t() | nil,
  tax_behavior: atom() | String.t() | nil,
  tax_breakdown: list() | nil,
  tax_code: String.t() | nil
}

Functions

from_map(map)

@spec from_map(map() | nil) :: t() | nil