<?php
/**
  * Ahead WebSoft Technologies Pvt Ltd.
  * @copyright  Copyright 2006-2026 Ahead WebSoft Technologies Pvt Ltd.
  * @license    https://www.socialengine.com/policies
*/

$settings   = Engine_Api::_()->getApi('settings', 'core');
$coreApi    = Engine_Api::_()->getApi('verify', 'core');

if (engine_in_array($_SERVER['SERVER_NAME'], ['localhost', '127.0.0.1'])) {
	$domainName = @base64_encode($settings->getSetting('core.license.domain'));
} else {
	$domainName = @base64_encode(str_replace(['http://', 'https://', 'www.'], ['', '', ''], $_SERVER['HTTP_HOST']));
}

$licenseKey  = @base64_encode($settings->getSetting('coinpayments.licensekey'));
$keyauth     = $settings->getSetting('coinpayments.license.keyauth');
$domainauth  = $settings->getSetting('core.license.domainauth');
$verifyCache = $settings->getSetting('coinpayments.license.cachedstatus', 'Inactive');

if (($domainName == $domainauth) && ($licenseKey == $keyauth) && ($verifyCache == 'Active')) {
	Zend_Registry::set('coinpayments_payment', 1);
} else {
	Zend_Registry::set('coinpayments_payment', 0);
}