summaryrefslogtreecommitdiffstats
path: root/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AccessToken.php
blob: 521429ac185f13ffdc7a7b4332e224590c5579e7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php

namespace PayPalCheckoutSdk\Core;


class AccessToken
{
    public $token;
    public $tokenType;
    public $expiresIn;
    private $createDate;

    public function __construct($token, $tokenType, $expiresIn)
    {
        $this->token = $token;
        $this->tokenType = $tokenType;
        $this->expiresIn = $expiresIn;
        $this->createDate = time();
    }

    public function isExpired()
    {
        return time() >= $this->createDate + $this->expiresIn;
    }
}