MishkaPay.ApplicationFee (Mishka Pay v0.0.1)

Copy Markdown View Source

The platform's cut of a sale made for a connected account (an application fee, fee_... at Stripe): what a checkout's :application_fee or :application_fee_percent took. Read with MishkaPay.fetch_application_fee/3 and MishkaPay.list_application_fees/3, and given back to the seller, all or part, with MishkaPay.refund_application_fee/4. A guarded_struct the provider fills in.

  • :provider, :id.
  • :amount: the fee taken; :amount_refunded: what was given back so far; :refunded: true once all of it was.
  • :account_id: the connected account that paid it.
  • :charge_id: the sale it was taken from.
  • :created_at.

Summary

Types

t()

The struct that builder/1 returns.

Functions

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

Types

t()

@type t() :: %MishkaPay.ApplicationFee{
  account_id: String.t() | nil,
  amount: Money.t() | nil,
  amount_refunded: Money.t() | nil,
  charge_id: String.t() | nil,
  created_at: DateTime.t() | nil,
  id: String.t(),
  provider: String.t(),
  refunded: boolean() | 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}
:amount_refundedMoney.t() | nilnovalidator {MishkaPay.Money, :field}
:refundedboolean() | nilnofalsevalidate(boolean)
:account_idString.t() | nilnovalidate(string)
:charge_idString.t() | nilnovalidate(string)
:created_atDateTime.t() | nilnovalidate(struct)

Functions

builder(attrs_or_input, error \\ false)

enforce_keys()

enforce_keys(field)

example()

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

keys()

keys(field)