Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/cvetdv.ru/bitrix/modules/yandex.market/lib/api/oauth2/accesstoken/ |
Upload File : |
<?php namespace Yandex\Market\Api\OAuth2\AccessToken; use Bitrix\Main; use Yandex\Market; class Response extends Market\Api\Reference\Response { const TOKEN_TYPE = 'bearer'; /** @var Main\Type\DateTime */ protected $initialDate; public function __construct($data) { parent::__construct($data); $this->initialDate = new Main\Type\DateTime(); } public function getTokenType() { return (string)$this->requireField('token_type'); } public function getAccessToken() { return (string)$this->requireField('access_token'); } public function getRefreshToken() { return (string)$this->requireField('refresh_token'); } public function getExpiresDate() { $result = clone $this->initialDate; $expireSeconds = $this->getExpiresSeconds(); $result->add('T' . $expireSeconds . 'S'); return $result; } public function getExpiresSeconds() { return (int)$this->getField('expires_in'); } }