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: oneMoneyper currency, ready to pay out.:pending: oneMoneyper currency, not available yet.
A balance may be below zero, such as after refunds or disputes larger than new sales.
Summary
Functions
A sample %MishkaPay.Balance{} populated from defaults + type-based fallbacks.
Types
@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.
| Field | Type | Required | Default | Description | Derives |
|---|---|---|---|---|---|
:provider | String.t() | nil | no | validate(string) | ||
:available | [Money.t()] | nil | no | [] | validate(list) | |
:pending | [Money.t()] | nil | no | [] | validate(list) | |
:transaction | MishkaPay.Balance.Transaction.t() | nil | no | One 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. | ||
:payout | MishkaPay.Balance.Payout.t() | nil | no | Money 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. |