com.paypal.api.openidconnect
Class Tokeninfo

java.lang.Object
  extended by com.paypal.api.openidconnect.Tokeninfo

public class Tokeninfo
extends Object


Constructor Summary
Tokeninfo()
          Default Constructor
Tokeninfo(String accessToken, String tokenType, Integer expiresIn)
          Parameterized Constructor
 
Method Summary
static Tokeninfo createFromAuthorizationCode(APIContext apiContext, CreateFromAuthorizationCodeParameters createFromAuthorizationCodeParameters)
          Creates an Access Token from an Authorization Code.
static Tokeninfo createFromAuthorizationCode(CreateFromAuthorizationCodeParameters createFromAuthorizationCodeParameters)
          Creates an Access Token from an Authorization Code.
static Tokeninfo createFromAuthorizationCodeForFpp(APIContext apiContext, CreateFromAuthorizationCodeParameters createFromAuthorizationCodeParameters)
          Creates an Access and a Refresh Tokens from an Authorization Code for future payment.
 Tokeninfo createFromRefreshToken(APIContext apiContext, CreateFromRefreshTokenParameters createFromRefreshTokenParameters)
          Creates an Access Token from an Refresh Token.
 Tokeninfo createFromRefreshToken(CreateFromRefreshTokenParameters createFromRefreshTokenParameters)
          Creates an Access Token from an Refresh Token.
 String getAccessToken()
          Getter for just accessToken without type (e.g., "EEwJ6tF9x5WCIZDYzyZGaz6Khbw7raYRIBV_WxVvgmsG")
 String getAccessTokenWithType()
          Getter for accessToken with token type (e.g., "Bearer: EEwJ6tF9x5WCIZDYzyZGaz6Khbw7raYRIBV_WxVvgmsG")
 Integer getExpiresIn()
          Getter for expiresIn
static String getLastRequest()
          Returns the last request sent to the Service
static String getLastResponse()
          Returns the last response returned by the Service
 String getRefreshToken()
          Getter for refreshToken
 String getScope()
          Getter for scope
 String getTokenType()
          Getter for tokenType
static void initConfig(File file)
          Initialize using a File(Properties file)
static void initConfig(InputStream is)
          Initialize using InputStream(of a Properties file)
static void initConfig(Properties properties)
          Initialize using Properties
 void setAccessToken(String accessToken)
          Setter for accessToken
 void setExpiresIn(Integer expiresIn)
          Setter for expiresIn
 void setRefreshToken(String refreshToken)
          Setter for refreshToken
 void setScope(String scope)
          Setter for scope
 void setTokenType(String tokenType)
          Setter for tokenType
 String toJSON()
          Returns a JSON string corresponding to object state
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Tokeninfo

public Tokeninfo()
Default Constructor


Tokeninfo

public Tokeninfo(String accessToken,
                 String tokenType,
                 Integer expiresIn)
Parameterized Constructor

Method Detail

getLastRequest

public static String getLastRequest()
Returns the last request sent to the Service

Returns:
Last request sent to the server

getLastResponse

public static String getLastResponse()
Returns the last response returned by the Service

Returns:
Last response got from the Service

initConfig

public static void initConfig(InputStream is)
                       throws PayPalRESTException
Initialize using InputStream(of a Properties file)

Parameters:
is - InputStream
Throws:
PayPalRESTException

initConfig

public static void initConfig(File file)
                       throws PayPalRESTException
Initialize using a File(Properties file)

Parameters:
file - File object of a properties entity
Throws:
PayPalRESTException

initConfig

public static void initConfig(Properties properties)
Initialize using Properties

Parameters:
properties - Properties object

setScope

public void setScope(String scope)
Setter for scope


getScope

public String getScope()
Getter for scope


setAccessToken

public void setAccessToken(String accessToken)
Setter for accessToken


getAccessToken

public String getAccessToken()
Getter for just accessToken without type (e.g., "EEwJ6tF9x5WCIZDYzyZGaz6Khbw7raYRIBV_WxVvgmsG")


getAccessTokenWithType

public String getAccessTokenWithType()
Getter for accessToken with token type (e.g., "Bearer: EEwJ6tF9x5WCIZDYzyZGaz6Khbw7raYRIBV_WxVvgmsG")


setRefreshToken

public void setRefreshToken(String refreshToken)
Setter for refreshToken


getRefreshToken

public String getRefreshToken()
Getter for refreshToken


setTokenType

public void setTokenType(String tokenType)
Setter for tokenType


getTokenType

public String getTokenType()
Getter for tokenType


setExpiresIn

public void setExpiresIn(Integer expiresIn)
Setter for expiresIn


getExpiresIn

public Integer getExpiresIn()
Getter for expiresIn


createFromAuthorizationCode

public static Tokeninfo createFromAuthorizationCode(CreateFromAuthorizationCodeParameters createFromAuthorizationCodeParameters)
                                             throws PayPalRESTException
Creates an Access Token from an Authorization Code.

Parameters:
createFromAuthorizationCodeParameters - Query parameters used for API call
Returns:
Tokeninfo
Throws:
PayPalRESTException

createFromAuthorizationCode

public static Tokeninfo createFromAuthorizationCode(APIContext apiContext,
                                                    CreateFromAuthorizationCodeParameters createFromAuthorizationCodeParameters)
                                             throws PayPalRESTException
Creates an Access Token from an Authorization Code.

Parameters:
apiContext - APIContext to be used for the call.
createFromAuthorizationCodeParameters - Query parameters used for API call
Returns:
Tokeninfo
Throws:
PayPalRESTException

createFromAuthorizationCodeForFpp

public static Tokeninfo createFromAuthorizationCodeForFpp(APIContext apiContext,
                                                          CreateFromAuthorizationCodeParameters createFromAuthorizationCodeParameters)
                                                   throws PayPalRESTException
Creates an Access and a Refresh Tokens from an Authorization Code for future payment.

Parameters:
apiContext - APIContext to be used for the call.
createFromAuthorizationCodeParameters - Query parameters used for API call
Returns:
Tokeninfo
Throws:
PayPalRESTException

createFromRefreshToken

public Tokeninfo createFromRefreshToken(CreateFromRefreshTokenParameters createFromRefreshTokenParameters)
                                 throws PayPalRESTException
Creates an Access Token from an Refresh Token.

Parameters:
createFromRefreshTokenParameters - Query parameters used for API call
Returns:
Tokeninfo
Throws:
PayPalRESTException

createFromRefreshToken

public Tokeninfo createFromRefreshToken(APIContext apiContext,
                                        CreateFromRefreshTokenParameters createFromRefreshTokenParameters)
                                 throws PayPalRESTException
Creates an Access Token from an Refresh Token.

Parameters:
apiContext - APIContext to be used for the call.
createFromRefreshTokenParameters - Query parameters used for API call
Returns:
Tokeninfo
Throws:
PayPalRESTException

toJSON

public String toJSON()
Returns a JSON string corresponding to object state

Returns:
JSON representation

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2015. All Rights Reserved.