Copyright | (C) 2016 Braden Walters |
---|---|
License | MIT (see LICENSE file) |
Maintainer | Braden Walters <vc@braden-walters.info> |
Stability | experimental |
Portability | ghc |
Safe Haskell | None |
Language | Haskell2010 |
- type ClientID = String
- type Secret = String
- type Seconds = Integer
- data AccessToken = AccessToken {
- aTokenScope :: [String]
- aToken :: String
- aTokenType :: String
- aTokenAppId :: String
- aTokenExpires :: Seconds
- type AccessTokenWithExpiration = (AccessToken, UTCTime)
- data AccessTokenError
- type AccessTokenResult = Either AccessTokenError AccessToken
- fetchAccessToken :: EnvironmentUrl -> ClientID -> Secret -> IO AccessTokenResult
- fetchAccessTokenWithExpiration :: EnvironmentUrl -> ClientID -> Secret -> IO AccessTokenWithExpirationResult
- safeExpirationTime :: UTCTime -> AccessToken -> UTCTime
Documentation
data AccessToken Source #
Access token returned from OAuth.
AccessToken | |
|
type AccessTokenWithExpiration = (AccessToken, UTCTime) Source #
An access token from OAuth together with its UTC expiration time.
data AccessTokenError Source #
Error while fetching access token.
type AccessTokenResult = Either AccessTokenError AccessToken Source #
Either an access token or the error encountered while fetching it.
fetchAccessToken :: EnvironmentUrl -> ClientID -> Secret -> IO AccessTokenResult Source #
Use a PayPal environment and login credentials to get an OAuth access token.
fetchAccessTokenWithExpiration :: EnvironmentUrl -> ClientID -> Secret -> IO AccessTokenWithExpirationResult Source #
Use a PayPal environment and login credentials to get an OAuth access token with an expiration time.
safeExpirationTime :: UTCTime -> AccessToken -> UTCTime Source #
Time at which the token should be considered expired. This is a few seconds before the time that PayPal gives us. Parameters are the time at which the access token was retrieved and the access token.