|
@@ 271-283 (lines=13) @@
|
| 268 |
|
* Get Balance Campaign |
| 269 |
|
* @link https://tech.yandex.ru/market/partner/doc/dg/reference/get-campaigns-id-balance-docpage/ |
| 270 |
|
*/ |
| 271 |
|
public function getBalance() |
| 272 |
|
{ |
| 273 |
|
$resource = 'campaigns/' . $this->campaignId . '/balance.json'; |
| 274 |
|
|
| 275 |
|
$response = $this->sendRequest('GET', $this->getServiceUrl($resource)); |
| 276 |
|
|
| 277 |
|
|
| 278 |
|
$decodedResponseBody = $this->getDecodedBody($response->getBody()); |
| 279 |
|
|
| 280 |
|
$getBalanceResponse = new Models\GetBalanceResponse($decodedResponseBody); |
| 281 |
|
|
| 282 |
|
return $getBalanceResponse->getBalance(); |
| 283 |
|
} |
| 284 |
|
|
| 285 |
|
|
| 286 |
|
/** |
|
@@ 297-307 (lines=11) @@
|
| 294 |
|
* |
| 295 |
|
* @return Models\Campaigns |
| 296 |
|
*/ |
| 297 |
|
public function getCampaigns() |
| 298 |
|
{ |
| 299 |
|
$resource = 'campaigns.json'; |
| 300 |
|
|
| 301 |
|
$response = $this->sendRequest('GET', $this->getServiceUrl($resource)); |
| 302 |
|
|
| 303 |
|
$decodedResponseBody = $this->getDecodedBody($response->getBody()); |
| 304 |
|
|
| 305 |
|
$getCampaignsResponse = new Models\GetCampaignsResponse($decodedResponseBody); |
| 306 |
|
return $getCampaignsResponse->getCampaigns(); |
| 307 |
|
} |
| 308 |
|
|
| 309 |
|
/** |
| 310 |
|
* Get User Campaigns by Login |
|
@@ 316-326 (lines=11) @@
|
| 313 |
|
* |
| 314 |
|
* @return Models\Campaigns |
| 315 |
|
*/ |
| 316 |
|
public function getCampaignsByLogin($login) |
| 317 |
|
{ |
| 318 |
|
$resource = 'campaigns/by_login/' . $login . '.json'; |
| 319 |
|
|
| 320 |
|
$response = $this->sendRequest('GET', $this->getServiceUrl($resource)); |
| 321 |
|
|
| 322 |
|
$decodedResponseBody = $this->getDecodedBody($response->getBody()); |
| 323 |
|
|
| 324 |
|
$getCampaignsResponse = new Models\GetCampaignsResponse($decodedResponseBody); |
| 325 |
|
return $getCampaignsResponse->getCampaigns(); |
| 326 |
|
} |
| 327 |
|
|
| 328 |
|
|
| 329 |
|
/** |
|
@@ 375-385 (lines=11) @@
|
| 372 |
|
* |
| 373 |
|
* @link http://api.yandex.ru/market/partner/doc/dg/reference/get-campaigns-id-orders-id.xml |
| 374 |
|
*/ |
| 375 |
|
public function getOrder($orderId) |
| 376 |
|
{ |
| 377 |
|
$resource = 'campaigns/' . $this->campaignId . '/orders/' . $orderId . '.json'; |
| 378 |
|
|
| 379 |
|
$response = $this->sendRequest('GET', $this->getServiceUrl($resource)); |
| 380 |
|
|
| 381 |
|
$decodedResponseBody = $this->getDecodedBody($response->getBody()); |
| 382 |
|
|
| 383 |
|
$getOrderResponse = new Models\GetOrderResponse($decodedResponseBody); |
| 384 |
|
return $getOrderResponse->getOrder(); |
| 385 |
|
} |
| 386 |
|
|
| 387 |
|
|
| 388 |
|
/** |