From e403f27eb2d7d7946c6d84588f05d84dd9c6c137 Mon Sep 17 00:00:00 2001 From: novoseltsev Date: Thu, 6 Feb 2025 12:52:01 +0200 Subject: [PATCH] TMONE-894 - add trackers --- README.md | 3 +++ .../Entities/Order/TrackingInfo.php | 26 ++++++++++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index bb9ba73..6e37f1f 100644 --- a/README.md +++ b/README.md @@ -147,6 +147,9 @@ $trackingInfo->setUserAgent ('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/53 $trackingInfo->setUserIPAddress ('10.0.2.2'); $trackingInfo->setUserLanguage ('en-US,en;q=0.8,uk;q=0.6,ru;q=0.4'); $trackingInfo->setUserLocalTime ('Tue May 27 2014 10:31:05 GMT+0300 (EEST)'); +$trackingInfo->setTrackers (array( + "ga" => "GA1.1.1479631296.1738839056" +)); $order->setTrackingInfo ($trackingInfo); diff --git a/src/API2Client/Entities/Order/TrackingInfo.php b/src/API2Client/Entities/Order/TrackingInfo.php index d6dd6f0..d022285 100644 --- a/src/API2Client/Entities/Order/TrackingInfo.php +++ b/src/API2Client/Entities/Order/TrackingInfo.php @@ -97,6 +97,9 @@ class TrackingInfo */ protected $tSource; + /** @var array */ + private $trackers; + /** * @param string $affiliateName */ @@ -354,7 +357,7 @@ public function getWebdesignTime () } /** - * @param \API2Client\Entities\Order\TrackingTSource $tSource + * @param TrackingTSource $tSource */ public function setTSource (TrackingTSource $tSource) { @@ -362,13 +365,29 @@ public function setTSource (TrackingTSource $tSource) } /** - * @return \API2Client\Entities\Order\TrackingTSource + * @return TrackingTSource */ public function getTSource () { return $this->tSource ? $this->tSource : new TrackingTSource (); } + /** + * @param array $trackers + */ + public function setTrackers (array $trackers) + { + $this->trackers = $trackers; + } + + /** + * @return array + */ + public function getTrackers () + { + return (array)$this->trackers; + } + /** * @return array */ @@ -392,6 +411,7 @@ public function toArray () 'utmCampaign' => $this->getUtmCampaign (), 'webdesign' => $this->getWebdesign (), 'webdesignTime' => $this->getWebdesignTime (), + 'trackers' => $this->getTrackers (), ); } -} \ No newline at end of file +}