Skip to content

Commit 6f420d6

Browse files
committed
Remove tracking url fetching reseller id
1 parent 4ed3044 commit 6f420d6

1 file changed

Lines changed: 3 additions & 26 deletions

File tree

modules/registrars/openprovider/Controllers/Hooks/Widgets/CrossSellWidget.php

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class CrossSellWidget extends \WHMCS\Module\AbstractWidget
7373

7474
/**
7575
* Tracking redirect base URL on your server.
76-
* Query params appended: ?reseller_hash_id=X&product=email|pdns&source=WHMCSCrossSellWidget
76+
* Query params appended: ?product=email|pdns&source=WHMCSCrossSellWidget
7777
*/
7878
const TRACKING_URL = 'https://assets.openprovider.com/crosssell/track.php';
7979

@@ -142,8 +142,7 @@ public function getData()
142142
* $config['margin_per_unit'];
143143

144144
// Build tracked CTA URL
145-
$resellerHashId = $this->getResellerHashId();
146-
$ctaUrl = $this->buildCtaUrl($resellerHashId, $selectedProduct, $config['setup_guide_url']);
145+
$ctaUrl = $this->buildCtaUrl($selectedProduct, $config['setup_guide_url']);
147146

148147
$result = [
149148
'hidden' => false,
@@ -156,7 +155,6 @@ public function getData()
156155
'estimated_revenue' => number_format($estimatedRevenue, 0, ',', ','),
157156
'cta_url' => $ctaUrl,
158157
'dismiss_url' => 'index.php?op_crosssell_action=dismiss&crosssell_product=' . $selectedProduct . '&token=' . generate_token('link'),
159-
'reseller_hash_id' => $resellerHashId,
160158
];
161159

162160
return $result;
@@ -546,39 +544,18 @@ public static function ensureDismissTableExists()
546544
self::$dismissTableChecked = true;
547545
}
548546

549-
/**
550-
* Get a unique reseller identifier using the WHMCS license key.
551-
* Hashed so we don't transmit the actual license key.
552-
*
553-
* @return string
554-
*/
555-
private function getResellerHashId()
556-
{
557-
try {
558-
$license = Capsule::table('tblconfiguration')
559-
->where('setting', 'License')
560-
->value('value');
561-
562-
return $license ? substr(hash('sha256', $license . 'op_crosssell'), 0, 16) : 'unknown';
563-
} catch (\Exception $e) {
564-
return 'unknown';
565-
}
566-
}
567-
568547
/**
569548
* Build the CTA URL with tracking parameters.
570549
*
571-
* @param string $resellerHashId
572550
* @param string $product 'email' or 'pdns'
573551
* @param string $fallbackUrl Direct setup guide URL
574552
* @return string
575553
*/
576-
private function buildCtaUrl($resellerHashId, $product, $fallbackUrl)
554+
private function buildCtaUrl($product, $fallbackUrl)
577555
{
578556
$baseUrl = self::USE_TRACKING_URL ? self::TRACKING_URL : $fallbackUrl;
579557

580558
$params = http_build_query([
581-
'reseller_hash_id' => $resellerHashId,
582559
'product' => $product,
583560
'source' => 'WHMCSCrossSellWidget',
584561
]);

0 commit comments

Comments
 (0)