Client affiliate information

If a WHMCS operator turns on the affiliate payment system, then a client account can become an affiliate. An affiliate record is attached to a specific client and provides configuration information to the affiliate system so that client can handle payments and commissions. It also tracks the balance available, amount withdrawn, and the number of visitors an affiliate has brought to an operator's WHMCS installation.

class Affiliate extends AbstractModel

Properties summary

Type Property Description
protected $table
protected $columnMap
protected $dates
protected $appends
int $id An affiliate record's unique id.
Carbon $date The date an affiliate record was added to a client.
int $clientId The id of the client associated with an affiliate record.
int $visitorCount The number of visitors who have followed affiliate links belonging to an affiliate account.
string $commissionType The type of commission payment made to an affiliate, either "percentage", "fixed", or null.
float $paymentAmount Either the percentage or fixed amount paid to an affiliate based on the commission type.
bool $isPaidOneTimeCommission Whether or not an affiliate is only paid commission on initial sale. Otherwise, an affiliate's commission applies to recurring payments.
float $balance The total balance of unclaimed commission belonging to an affiliate.
float $amountWithdrawn The total balance withdrawn by an affiliate.
Carbon $createdAt The date an affiliate record was created.
Carbon $updatedAt The date an affiliate record was last modified.
float $pendingCommissionAmount
Accounts[]|Relation $accounts
Pending[]|Relation $pending
Client $client The client associated with an affiliate record.
History[]|Relation $history
Hit[]|Relation $hits
Referrer[]|Relation $referrers
Withdrawals[]|Relation $withdrawals

Methods summary

Return Type Method Name Description
static  boot() -
Relation accounts() -
BelongsTo client() Each affiliate belongs to one client.
Relation history() -
Relation hits() -
Relation referrers() -
Relation withdrawals() -
Relation pending() -
string getReferralLink() -
string getAdminLink() -
string getFullAdminUrl() -
float getPendingCommissionAmountAttribute() -

Details

static boot ()

Relation accounts ()

Return Value

Relation

BelongsTo client ()

Each affiliate belongs to one client.

Return Value

BelongsTo

Relation history ()

Return Value

Relation

Relation hits ()

Return Value

Relation

Relation referrers ()

Return Value

Relation

Relation withdrawals ()

Return Value

Relation

Relation pending ()

Return Value

Relation

Return Value

string

Return Value

string

string getFullAdminUrl ()

Return Value

string

float getPendingCommissionAmountAttribute ()

Return Value

float