Integration/BlacklistIntegration.php
public function doEnhancement(Lead $lead)
    {
        $save = false;

        if (!empty($lead)) {
            // Only perform lookup on the first occurring phone number, home and then (if not found) mobile.
            // Presumably phone numbers should be validated by this point, but let's make sure, just in case.
            $phone = $this->phoneValidate($lead->getPhone());
            if (!$phone) {
                $phone = $this->phoneValidate($lead->getMobile());
            }
            if ($phone) {
                $settings   = $this->getIntegrationSettings()->getFeatureSettings();
                $ageMinutes = isset($settings['age']) ? intval($settings['age']) : self::AGE_DEFAULT;

                try {
                    /** @var PluginEnhancerBlacklist $record */
                    $record = $this->getModel()->getRecord($phone, $ageMinutes);
                } catch (Exception $exception) {
                    $this->handleEnchancerException('Blacklist', $exception);
                    $this->logger->error('Blacklist Enhancer: '.$exception->getMessage());
                }
                if ($record) {
                    $lead->addUpdatedField('blacklist_result', $record->getResult());
                    $lead->addUpdatedField('blacklist_code', $record->getCode());
                    $lead->addUpdatedField('blacklist_wireless', $record->getWireless());
                    $save = true;
                }
            }
        }

        return $save;
    }
public function doEnhancement(Lead $lead)
    {
        $save = false;

        if (!empty($lead)) {
            // Only perform lookup on the first occurring phone number, home and then (if not found) mobile.
            // Presumably phone numbers should be validated by this point, but let's make sure, just in case.
            $phone = $this->phoneValidate($lead->getPhone());
            if (!$phone) {
                $phone = $this->phoneValidate($lead->getMobile());
            }
            if ($phone) {
                $settings   = $this->getIntegrationSettings()->getFeatureSettings();
                $ageMinutes = isset($settings['age']) ? intval($settings['age']) : self::AGE_DEFAULT;

                try {
                    /** @var PluginEnhancerBlacklist $record */
                    $record = $this->getModel()->getRecord($phone, $ageMinutes);
                } catch (Exception $exception) {
                    $this->handleEnchancerException('Blacklist', $exception);
                    $this->logger->error('Blacklist Enhancer: '.$exception->getMessage());
                }
                if ($record) {
                    $lead->addUpdatedField('blacklist_result', $record->getResult());
                    $lead->addUpdatedField('blacklist_code', $record->getCode());
                    $lead->addUpdatedField('blacklist_wireless', $record->getWireless());
                    $save = true;
                }
            }
        }

        return $save;
    }
@param Lead $lead

@return bool

@throws \GuzzleHttp\Exception\GuzzleException