MishkaPay.TaxCalculation.Transaction (Mishka Pay v0.0.1)

Copy Markdown View Source

A sale reported to the provider's tax records from a MishkaPay.TaxCalculation, with MishkaPay.record_tax/4: the provider then counts its tax in the site's tax reports and filings. A guarded_struct the provider fills in.

  • :provider, :id (tax_... at Stripe).
  • :reference: the caller's own id of the sale, such as an order id; one sale per reference.
  • :calculation_id: the calculation it was made from.
  • :customer_id: the provider customer, when the calculation named one.
  • :posted_at: when the tax counts as owed; :created_at: when the provider made it.

Summary

Types

t()

The struct that builder/1 returns.

Functions

A sample %MishkaPay.TaxCalculation.Transaction{} populated from defaults + type-based fallbacks.

Types

t()

@type t() :: %MishkaPay.TaxCalculation.Transaction{
  calculation_id: String.t() | nil,
  created_at: DateTime.t() | nil,
  customer_id: String.t() | nil,
  id: String.t() | nil,
  posted_at: DateTime.t() | nil,
  provider: String.t() | nil,
  reference: String.t() | nil
}

The struct that builder/1 returns.

FieldTypeRequiredDefaultDescriptionDerives
:providerString.t() | nilnovalidate(string)
:idString.t() | nilnovalidate(string)
:referenceString.t() | nilnovalidate(string)
:calculation_idString.t() | nilnovalidate(string)
:customer_idString.t() | nilnovalidate(string)
:posted_atDateTime.t() | nilnovalidate(struct)
:created_atDateTime.t() | nilnovalidate(struct)

Functions

builder(attrs_or_input, error \\ false)

enforce_keys()

enforce_keys(field)

example()

A sample %MishkaPay.TaxCalculation.Transaction{} populated from defaults + type-based fallbacks.

keys()

keys(field)