Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
308 changes: 203 additions & 105 deletions src/Client/TradeTrackerClient.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Exception/AuthenticationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
class AuthenticationException extends \Exception
{

}
}
2 changes: 1 addition & 1 deletion src/Filter/AffiliateSiteFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,4 +217,4 @@ public function setExcludeInfo(bool $excludeInfo)
{
$this->excludeInfo = $excludeInfo;
}
}
}
2 changes: 1 addition & 1 deletion src/Filter/CampaignFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,4 +282,4 @@ public function setExcludeInfo(bool $excludeInfo)
{
$this->excludeInfo = $excludeInfo;
}
}
}
2 changes: 1 addition & 1 deletion src/Filter/CampaignNewsItemFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,4 @@ public function setOffset($offset)
{
$this->offset = $offset;
}
}
}
2 changes: 1 addition & 1 deletion src/Filter/ClickTransactionFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,4 @@ public function setOffset($offset)
{
$this->offset = $offset;
}
}
}
2 changes: 1 addition & 1 deletion src/Filter/FeedFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function getAssignmentStatus()
/**
* @param string $assignmentStatus
*/
public function setAssignmentStatus$assignmentStatus)
public function setAssignmentStatus($assignmentStatus)
{
$this->assignmentStatus = $assignmentStatus;
}
Expand Down
195 changes: 195 additions & 0 deletions src/Filter/FeedProductFilter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
<?php

namespace Hypeit\TradeTracker\Filter;

class FeedProductFilter
{
/**
* @var int
*/
private $feedID;

/**
* @var string
*/
private $feedCategoryName;

/**
* @var int
*/
private $campaignID;

/**
* @var int
*/
private $campaignCategoryID;

/**
* @var string
*/
private $query;

/**
* @var float
*/
private $priceFrom;

/**
* @var float
*/
private $priceTo;

/**
* @var int
*/
private $limit;

/**
* @var int
*/
private $offset;

/**
* @return int
*/
public function getFeedId()
{
return $this->feedID;
}

/**
* @param $feedID
*/
public function setFeedId($feedID)
{
$this->feedID = $feedID;
}

/**
* @return string
*/
public function getFeedCategoryName()
{
return $this->feedCategoryName;
}

/**
* @param $feedCategoryName
*/
public function setFeedCategoryName($feedCategoryName)
{
$this->feedCategoryName = $feedCategoryName;
}

/**
* @return int
*/
public function getCampaignId()
{
return $this->campaignID;
}

/**
* @param $campaignID
*/
public function setCampaignId($campaignID)
{
$this->campaignID = $campaignID;
}

/**
* @return int
*/
public function getCampaignCategoryId()
{
return $this->campaignCategoryID;
}

/**
* @param $campaignCategoryID
*/
public function setCampaignCategoryId($campaignCategoryID)
{
$this->campaignCategoryID = $campaignCategoryID;
}

/**
* @return string
*/
public function getQuery()
{
return $this->query;
}

/**
* @param $query
*/
public function setQuery($query)
{
$this->query = $query;
}

/**
* @return float
*/
public function getPriceFrom()
{
return $this->priceFrom;
}

/**
* @param $priceFrom
*/
public function setPriceFrom($priceFrom)
{
$this->priceFrom = $priceFrom;
}

/**
* @return float
*/
public function getPriceTo()
{
return $this->priceTo;
}

/**
* @param $priceTo
*/
public function setPriceTo($priceTo)
{
$this->priceTo = $priceTo;
}

/**
* @return int
*/
public function getLimit()
{
return $this->limit;
}

/**
* @param $limit
*/
public function setLimit($limit)
{
$this->limit = $limit;
}

/**
* @return int
*/
public function getOffset()
{
return $this->offset;
}

/**
* @param $offset
*/
public function setOffset($offset)
{
$this->offset = $offset;
}
}
48 changes: 48 additions & 0 deletions src/Filter/PaymentFilter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php

namespace Hypeit\TradeTracker\Filter;

class PaymentFilter
{
/**
* @var string
*/
private $billDateFrom;

/**
* @var string
*/
private $billDateTo;

/**
* @return string
*/
public function getBillDateFrom()
{
return $this->billDateFrom;
}

/**
* @param string $billDateFrom
*/
public function setBillDateFrom($billDateFrom)
{
$this->billDateFrom = $billDateFrom;
}

/**
* @return string
*/
public function getBillDateTo()
{
return $this->billDateTo;
}

/**
* @param string $billDateTo
*/
public function setBillDateTo($billDateTo)
{
$this->billDateTo = $billDateTo;
}
}
2 changes: 1 addition & 1 deletion src/Filter/ReportAffiliateSiteFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ public function setDateTo($dateTo)
{
$this->dateTo = $dateTo;
}
}
}
2 changes: 1 addition & 1 deletion src/Mapper/AffiliateSiteCategoryMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ public function hydrate($value)

return $affiliateSiteCategory;
}
}
}
2 changes: 1 addition & 1 deletion src/Mapper/AffiliateSiteInfoMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ public function hydrate($value)

return $affiliateSiteInfo;
}
}
}
7 changes: 5 additions & 2 deletions src/Mapper/AffiliateSiteMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ public function hydrate($value)
$affiliateSite->setId($value->ID);
$affiliateSite->setName($value->name);
$affiliateSite->setUrl($value->URL);
$affiliateSite->setInfo((new AffiliateSiteInfoMapper())->hydrate($value->info));

if (null !== $value->info) {
$affiliateSite->setInfo((new AffiliateSiteInfoMapper())->hydrate($value->info));
}

return $affiliateSite;
}
}
}
2 changes: 1 addition & 1 deletion src/Mapper/AffiliateSiteStatusMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ public function hydrate($value)

return $affiliateSiteStatus;
}
}
}
2 changes: 1 addition & 1 deletion src/Mapper/AffiliateSiteTypeMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ public function hydrate($value)

return $affiliateSiteType;
}
}
}
30 changes: 30 additions & 0 deletions src/Mapper/AttributedAffiliateSiteMapper.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace Hypeit\TradeTracker\Mapper;

use Hypeit\TradeTracker\Model\AttributedAffiliateSite;

class AttributedAffiliateSiteMapper implements MapperInterface
{
/**
* {@inheritdoc}
*
* @return AttributedAffiliateSite
*/
public function hydrate($value)
{
$attributedAffiliateSite = new AttributedAffiliateSite();
$attributedAffiliateSite->setAffiliateSiteId($value->affiliateSiteID);
$attributedAffiliateSite->setCommission($value->commission);
$attributedAffiliateSite->setPosition($value->position);
$attributedAffiliateSite->setIp($value->IP);
$attributedAffiliateSite->setTransactionType((new TransactionTypeMapper())->hydrate($value->transactionType));
$attributedAffiliateSite->setTransactionStatus(
(new TransactionStatusMapper())->hydrate($value->transactionStatus)
);
$attributedAffiliateSite->setReference($value->reference);
$attributedAffiliateSite->setRegistrationDate(new \DateTime($value->registrationDate));

return $attributedAffiliateSite;
}
}
29 changes: 29 additions & 0 deletions src/Mapper/AttributionMapper.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace Hypeit\TradeTracker\Mapper;

use Hypeit\TradeTracker\Model\Attribution;

class AttributionMapper implements MapperInterface
{
/**
* {@inheritdoc}
*
* @return Attribution
*/
public function hydrate($value)
{
$attributedAffiliateSiteMapper = new AttributedAffiliateSiteMapper();

$attribution = new Attribution();
$data = [];

foreach ($value->affiliateSites as $affiliateSite) {
$data[] = $attributedAffiliateSiteMapper->hydrate($affiliateSite);
}

$attribution->setAffiliateSites($data);

return $attribution;
}
}
Loading