Skip to content

Transaction

An individual payout transaction for a single affiliate within a payout batch.

Table: fa_payout_transactions
Class: FluentAffiliate\\App\\Models\\Transaction.php

Columns

ColumnTypeNullableDefaultDescription
idBIGINT(20)NOPrimary key, auto-increment.
created_byBIGINT(20)YESWordPress user ID of the admin who created the payout.
affiliate_idBIGINT(20)YESAffiliate who earned this referral.
payout_idBIGINT(20)YESParent payout record.
total_amountDOUBLEYES0Sum of all transactions in this payout.
payout_methodVARCHAR(100)YESmanualDelivery method — manual, paypal, etc.
statusVARCHAR(100)YESpaidRecord status.
currencyCHAR(3)YESISO 4217 currency code (e.g. USD).
settingsLONGTEXTYESSerialized JSON settings blob.
created_atTIMESTAMPYESTimestamp when the record was created.
updated_atTIMESTAMPYESTimestamp when the record was last updated.

Relationships

MethodTypeTargetDescription
affiliate()belongsToAffiliateAffiliate receiving this payment.
payout()belongsToPayoutParent payout batch.

Query Scopes

ScopeDescription
ofStatus($status)Filter by status.

Usage Example

php
use FluentAffiliate\App\Models\Transaction;

$paid = Transaction::ofStatus('paid')
    ->where('affiliate_id', $affiliateId)
    ->sum('total_amount');

Released under the GPL-2.0 License.