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.
:provider,:id: the provider's id of it (txn_...at Stripe).:amount: what moved, before fees; below zero when money left the balance.:fee: what the provider kept.:net: what the balance changed by,:amountless:fee.:type: the provider's own name for it, such as"charge","refund"or"payout".:source_id: the provider object it came from, such as a charge or a refund.:status::availableor:pending.:description,:available_at(when its money is available),:created_at.
Summary
Functions
A sample %MishkaPay.Balance.Transaction{} populated from defaults + type-based fallbacks.
Types
@type t() :: %MishkaPay.Balance.Transaction{ amount: Money.t() | nil, available_at: DateTime.t() | nil, created_at: DateTime.t() | nil, description: String.t() | nil, fee: Money.t() | nil, id: String.t() | nil, net: Money.t() | nil, provider: String.t() | nil, source_id: String.t() | nil, status: (:available | :pending) | nil, type: String.t() | nil }
The struct that builder/1 returns.
| Field | Type | Required | Default | Description | Derives |
|---|---|---|---|---|---|
:provider | String.t() | nil | no | validate(string) | ||
:id | String.t() | nil | no | validate(string) | ||
:amount | Money.t() | nil | no | validator {MishkaPay.Money, :signed_field} | ||
:fee | Money.t() | nil | no | validator {MishkaPay.Money, :signed_field} | ||
:net | Money.t() | nil | no | validator {MishkaPay.Money, :signed_field} | ||
:type | String.t() | nil | no | validate(string) | ||
:source_id | String.t() | nil | no | validate(string) | ||
:status | :available | :pending | nil | no | validate(enum=Atom[available::pending]) | ||
:description | String.t() | nil | no | validate(string) | ||
:available_at | DateTime.t() | nil | no | validate(struct) | ||
:created_at | DateTime.t() | nil | no | validate(struct) |