public function onAfterValidateCustomerSubscription(mixed $customer, array $services, mixed $checkin) : bool

Fires after checking whether a customer owns an active subscription.


Description

This hook can be used to apply additional conditions to the subscription validation.

When this hook triggers, the system already validated all the default conditions.

NOTE: calling $customer->isSubscribed() would result in recursion.


Parameters

$customer

(VAPCustomer)  The object holding the customer details.

$id

(array)  A list of services to check.

$checkin

(string)  An optional check-in date (UTC).

Return Value

Boolean. True to flag the customer as subscribed, false to flag it as expired.


Example

/**
 * This hook can be used to apply additional conditions to the subscription validation.
 * When this hook triggers, the system already validated all the default conditions.
 *
 * @param   VAPCustomer  $customer  The customer details.
 * @param   array        $services  A list of services to check.
 * @param   mixed        $checkin   An optional check-in date (UTC). 
 *
 * @return  boolean      True to flag the customer as subscribed, false to flag it as expired.
 */
public function onAfterValidateCustomerSubscription($customer, $id, $checkin)
{
    /**
     * @todo apply further conditions
     */

    return true;
}

Changelog

VersionDescription
1.7 Introduced.
Last Update: 2021-10-08 16:50
Helpful?