@@ 98-127 (lines=30) @@ | ||
95 | * @param int $merchantID |
|
96 | * @return array of Deal |
|
97 | */ |
|
98 | public function getDeals($merchantID=NULL,int $page=0,int $items_per_page=10 ): DealsResultset |
|
99 | { |
|
100 | $arrResult = array(); |
|
101 | $arrResponse = $this->_apiClient->getFullEarnings(null, null, null, $this->_username, $this->_password); |
|
102 | foreach($arrResponse as $response) { |
|
103 | $Deal = Deal::createInstance(); |
|
104 | $Deal->transaction_ID = $response->transactionID; |
|
105 | $Deal->affiliate_ID = $response->affiliate_ID; |
|
106 | $Deal->campaign_name = $response->campaignName; |
|
107 | $Deal->campaign_ID = $response->campaignID; |
|
108 | $date = new \DateTime($response->date); |
|
109 | $Deal->date = $response->date; |
|
110 | $Deal->programName = $response->program_name; |
|
111 | $Deal->merchant_ID = $response->programID; |
|
112 | $Deal->commission = $response->commission; |
|
113 | $Deal->amount = $response->saleValue; |
|
114 | $Deal->status = $response->status; |
|
115 | $Deal->referrer = $response->referrer; |
|
116 | if($merchantID > 0) { |
|
117 | if($merchantID == $response->programID) { |
|
118 | $arrResult[] = $Deal; |
|
119 | } |
|
120 | } |
|
121 | else { |
|
122 | $arrResult[] = $Deal; |
|
123 | } |
|
124 | } |
|
125 | ||
126 | return $arrResult; |
|
127 | } |
|
128 | ||
129 | /** |
|
130 | * @param \DateTime $dateFrom |
@@ 96-125 (lines=30) @@ | ||
93 | * @param int $merchantID |
|
94 | * @return array of Deal |
|
95 | */ |
|
96 | public function getDeals($merchantID=NULL,int $page=0,int $items_per_page=10 ): DealsResultset |
|
97 | { |
|
98 | $arrResult = array(); |
|
99 | $arrResponse = $this->_apiClient->getFullEarnings(null, null, null, $this->_username, $this->_password); |
|
100 | foreach($arrResponse as $response) { |
|
101 | $Deal = Deal::createInstance(); |
|
102 | $Deal->transaction_ID = $response->transactionID; |
|
103 | $Deal->affiliate_ID = $response->affiliate_ID; |
|
104 | $Deal->campaign_name = $response->campaignName; |
|
105 | $Deal->campaign_ID = $response->campaignID; |
|
106 | $date = new \DateTime($response->date); |
|
107 | $Deal->date = $response->date; |
|
108 | $Deal->programName = $response->program_name; |
|
109 | $Deal->merchant_ID = $response->programID; |
|
110 | $Deal->commission = $response->commission; |
|
111 | $Deal->amount = $response->saleValue; |
|
112 | $Deal->status = $response->status; |
|
113 | $Deal->referrer = $response->referrer; |
|
114 | if($merchantID > 0) { |
|
115 | if($merchantID == $response->programID) { |
|
116 | $arrResult[] = $Deal; |
|
117 | } |
|
118 | } |
|
119 | else { |
|
120 | $arrResult[] = $Deal; |
|
121 | } |
|
122 | } |
|
123 | ||
124 | return $arrResult; |
|
125 | } |
|
126 | ||
127 | /** |
|
128 | * @param \DateTime $dateFrom |