MishkaPay.Balance.Payout (Mishka Pay v0.0.1)

Copy Markdown View Source

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.

  • :provider, :id.
  • :amount: what is paid out.
  • :status: :pending, :in_transit, :paid, :failed or :canceled.
  • :arrival_at: when it is expected at the bank, or arrived.
  • :automatic: true when the provider's payout schedule made it, false when someone asked for it.
  • :method: "standard" or "instant".
  • :destination_id: the bank account or card it goes to.
  • :failure_code, :failure_message: why it failed, in the provider's words.
  • :description, :created_at.

MishkaPay.list_balance_transactions/3 with payout_id: lists what one automatic payout paid out.

Summary

Types

t()

The struct that builder/1 returns.

Functions

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

Types

t()

@type t() :: %MishkaPay.Balance.Payout{
  amount: Money.t() | nil,
  arrival_at: DateTime.t() | nil,
  automatic: boolean() | nil,
  created_at: DateTime.t() | nil,
  description: String.t() | nil,
  destination_id: String.t() | nil,
  failure_code: String.t() | nil,
  failure_message: String.t() | nil,
  id: String.t(),
  method: String.t() | nil,
  provider: String.t(),
  status: (:pending | :in_transit | :paid | :failed | :canceled) | nil
}

The struct that builder/1 returns.

FieldTypeRequiredDefaultDescriptionDerives
:providerString.t()yesvalidate(not_nil_value, string)
:idString.t()yesvalidate(not_nil_value, string, not_empty)
:amountMoney.t() | nilnovalidator {MishkaPay.Money, :field}
:status:pending | :in_transit | :paid | :failed | :canceled | nilnovalidate(enum=Atom[pending::in_transit::paid::failed::canceled])
:arrival_atDateTime.t() | nilnovalidate(struct)
:automaticboolean() | nilnofalsevalidate(boolean)
:methodString.t() | nilnovalidate(string)
:destination_idString.t() | nilnovalidate(string)
:failure_codeString.t() | nilnovalidate(string)
:failure_messageString.t() | nilnovalidate(string)
:descriptionString.t() | nilnovalidate(string)
:created_atDateTime.t() | nilnovalidate(struct)

Functions

builder(attrs_or_input, error \\ false)

enforce_keys()

enforce_keys(field)

example()

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

keys()

keys(field)