C# Класс PayPal.OAuthTokenCredential

OAuthTokenCredential is used for generation of OAuth Token used by PayPal REST API service. clientId and clientSecret are required by the class to generate OAuth Token, the resulting token is of the form "Bearer xxxxxx". The class has two constructors, one of it taking an additional Dictionary used for dynamic configuration.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
GetAccessToken ( ) : string

Returns the currently cached access token. If no access token was previously cached, or if the current access token is expired, then a new one is generated and returned.

OAuthTokenCredential ( string clientId, string clientSecret ) : System

Client Id and Secret for the OAuth

OAuthTokenCredential ( string clientId, string clientSecret, string>.Dictionary config ) : System

Client Id and Secret for the OAuth

Приватные методы

Метод Описание
ConvertClientCredentialsToBase64String ( string clientId, string clientSecret ) : string

Covnerts the specified client credentials to a base-64 string for authorization purposes.

GenerateOAuthToken ( string base64ClientId ) : string

Generates a new OAuth token useing the specified client credentials in the authorization request.

Описание методов

GetAccessToken() публичный Метод

Returns the currently cached access token. If no access token was previously cached, or if the current access token is expired, then a new one is generated and returned.
Thrown if clientId or clientSecret are null or empty. Thrown if there is an issue converting the credentials to a formatted authorization string. Thrown if authorization fails as a result of providing invalid credentials. Thrown if authorization fails and an HTTP error response is received. Thrown if there is an issue attempting to connect to PayPal's services. Thrown if there is an error with any informaiton provided by the . Thrown for any other general exception. See inner exception for further details.
public GetAccessToken ( ) : string
Результат string

OAuthTokenCredential() публичный Метод

Client Id and Secret for the OAuth
public OAuthTokenCredential ( string clientId, string clientSecret ) : System
clientId string
clientSecret string
Результат System

OAuthTokenCredential() публичный Метод

Client Id and Secret for the OAuth
public OAuthTokenCredential ( string clientId, string clientSecret, string>.Dictionary config ) : System
clientId string
clientSecret string
config string>.Dictionary
Результат System