setClientId() public method

public setClientId ( string $clientId )
$clientId string
示例#1
0
<?php

$settings = (require_once '../settings.php');
use Yandex\Market\Partner\PartnerClient;
use Yandex\Common\Exception\ForbiddenException;
$errorMessage = false;
$order = null;
//Is auth
if (isset($_COOKIE['yaAccessToken']) && isset($_COOKIE['yaClientId']) && isset($_GET['campaignId']) && $_GET['campaignId'] && isset($_GET['orderId']) && $_GET['orderId']) {
    $market = new PartnerClient($_COOKIE['yaAccessToken']);
    $market->setClientId($_COOKIE['yaClientId']);
    $market->setLogin($settings['global']['marketLogin']);
    try {
        $market->setCampaignId($_GET['campaignId']);
        if (isset($_GET['status']) && $_GET['status']) {
            if (isset($_GET['substatus']) && $_GET['substatus']) {
                $market->setOrderStatus($_GET['orderId'], $_GET['status'], $_GET['substatus']);
            } else {
                $market->setOrderStatus($_GET['orderId'], $_GET['status']);
            }
        }
        /** @var Yandex\Market\Models\Order $orders */
        $order = $market->getOrder($_GET['orderId']);
    } catch (ForbiddenException $ex) {
        $errorMessage = $ex->getMessage();
        $errorMessage .= '<p>Возможно, у приложения нет прав на доступ к ресурсу. Попробуйте ' . '<a href="' . rtrim(str_replace($_SERVER['DOCUMENT_ROOT'], '', __DIR__), "/") . "/../OAuth/" . '">авторизироваться</a> и повторить.</p>';
    } catch (Exception $ex) {
        $errorMessage = $ex->getMessage();
    }
}
$orderStatusesTexts = array(PartnerClient::ORDER_STATUS_RESERVED => 'заказ в резерве', PartnerClient::ORDER_STATUS_UNPAID => 'заказ оформлен, но еще не оплачен', PartnerClient::ORDER_STATUS_PROCESSING => 'заказ находится в обработке', PartnerClient::ORDER_STATUS_DELIVERY => 'заказ передан в доставку', PartnerClient::ORDER_STATUS_PICKUP => 'заказ доставлен в пункт самовывоза', PartnerClient::ORDER_STATUS_DELIVERED => 'заказ получен покупателем', PartnerClient::ORDER_STATUS_CANCELLED => 'заказ отменен');