MishkaPay.Balance (Mishka Pay v0.0.1)

Copy Markdown View Source

The money a provider holds for the seller, read with MishkaPay.fetch_balance/2. A guarded_struct the provider fills in.

  • :provider: whose balance.
  • :available: one Money per currency, ready to pay out.
  • :pending: one Money per currency, not available yet.

A balance may be below zero, such as after refunds or disputes larger than new sales.

Summary

Types

t()

The struct that builder/1 returns.

Functions

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

Types

t()

@type t() :: %MishkaPay.Balance{
  available: [Money.t()] | nil,
  payout: MishkaPay.Balance.Payout.t() | nil,
  pending: [Money.t()] | nil,
  provider: String.t() | nil,
  transaction: MishkaPay.Balance.Transaction.t() | nil
}

The struct that builder/1 returns.

FieldTypeRequiredDefaultDescriptionDerives
:providerString.t() | nilnovalidate(string)
:available[Money.t()] | nilno[]validate(list)
:pending[Money.t()] | nilno[]validate(list)
:transactionMishkaPay.Balance.Transaction.t() | nilnoOne movement of the seller's balance at the provider: a charge, a refund, a fee, a payout. Listed with MishkaPay.list_balance_transactions/3, such as every one a payout paid out. A guarded_struct the provider fills in.
:payoutMishkaPay.Balance.Payout.t() | nilnoMoney paid out of an account's balance to its bank account or card (a payout, po_... at Stripe): the platform's own, or, with a site's keys that name a connected account, the seller's. Read with MishkaPay.fetch_payout/3 and MishkaPay.list_payouts/3, and stopped with MishkaPay.cancel_payout/3 while it is still :pending. A guarded_struct the provider fills in.

Functions

builder(attrs_or_input, error \\ false)

enforce_keys()

enforce_keys(field)

example()

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

keys()

keys(field)