Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultSchedule = schedule.Schedule{Type: schedule.DailyRolling, Period: 30}
DefaultSchedule is the clawback buffer a payable matures through: 30 days daily-rolling, the same default affiliate.New seeds.
Functions ¶
func Qualify ¶ added in v1.49.61
Qualify is the Pending -> Payable transition, and the ONE definition of when a commission has matured.
A commission is EARNED the moment the referee spends, but it is not yet ours to pay: the charge behind it can still be refunded or charged back. It becomes PAYABLE once it is older than the clawback buffer. That buffer is exactly what schedule.Schedule already computes and what the payout crons already filtered on — this supplies the transition they were waiting for.
Nothing in the repo ever wrote Payable while four consumers filtered on it, so every commission accrued Pending and was structurally unpayable. Returns the number of fees matured.
Types ¶
type Ethereum ¶
type Ethereum struct {
FinalTransactionHash string `json:"finalTransactionHash,omitempty"`
FinalTransactionCost blockchains.BigNumber `json:"finalTransactionCost,omitempty"`
FinalAddress string `json:"finalAddress,omitempty"`
FinalAmount blockchains.BigNumber `json:"finalAmount,omitempty"`
}
type Fee ¶
type Fee struct {
mixin.Model[Fee]
Name string `json:"name"`
// Type names WHY we owe (which program earned it); PayeeId names WHO. One
// payee reference, not one field per program — the program is a field on the
// payable, not a shape of it.
Type Type `json:"type"`
PayeeId string `json:"payeeId,omitempty"`
// PaymentId is the event that earned it — the charge or usage transaction.
PaymentId string `json:"paymentId"`
Commission commission.Commission `json:"commission,omitempty"`
Currency currency.Type `json:"currency"`
Amount currency.Cents `json:"amount"`
AmountRefunded currency.Cents `json:"amountRefunded,omitempty"`
Status Status `json:"status" orm:"default:pending"`
Ethereum Ethereum `json:"ethereum"`
Bitcoin Bitcoin `json:"bitcoin"`
// Stripe livemode
Live bool `json:"live"`
// Internal testing flag
Test bool `json:"-"`
}