public abstract class PayPalResource extends PayPalModel
| Constructor and Description |
|---|
PayPalResource() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
configureAndExecute(APIContext apiContext,
HttpMethod httpMethod,
java.lang.String resourcePath,
java.util.Map<java.lang.String,java.lang.String> headersMap,
java.lang.String payLoad,
java.lang.Class<T> clazz)
Deprecated.
Please use
configureAndExecute(APIContext, HttpMethod, String, String, Class) instead. Headers could be passed directly
to #APIContext itself. |
static <T> T |
configureAndExecute(APIContext apiContext,
HttpMethod httpMethod,
java.lang.String resourcePath,
java.lang.String payLoad,
java.lang.Class<T> clazz)
Configures and executes REST call
|
static <T> T |
configureAndExecute(APIContext apiContext,
HttpMethod httpMethod,
java.lang.String resourcePath,
java.lang.String payLoad,
java.lang.Class<T> clazz,
java.lang.String accessToken)
Configures and executes REST call: Supports JSON
|
static <T> T |
configureAndExecute(java.lang.String accessToken,
HttpMethod httpMethod,
java.lang.String resourcePath,
java.lang.String payLoad,
java.lang.Class<T> clazz)
Deprecated.
Please use
configureAndExecute(APIContext, HttpMethod, String, String, Class) instead.
Passing APIContext gives us better information than just raw access token. |
static APICallPreHandler |
createAPICallPreHandler(java.util.Map<java.lang.String,java.lang.String> configurationMap,
java.lang.String payLoad,
java.lang.String resourcePath,
java.util.Map<java.lang.String,java.lang.String> headersMap,
java.lang.String accessToken,
java.lang.String requestId,
SDKVersion sdkVersion)
Returns a implementation of
APICallPreHandler for the underlying
layer. |
ClientCredentials |
getClientCredential()
Deprecated.
Please use static method `getCredential` instead.
Returns ClientCredentials with client id and client secret from configuration Map.
|
static java.lang.String |
getClientID()
Return Client ID from configuration Map
|
static java.lang.String |
getClientSecret()
Returns Client Secret from configuration Map
|
static java.util.Map<java.lang.String,java.lang.String> |
getConfigurations() |
static ClientCredentials |
getCredential()
Returns ClientCredentials with client id and client secret from configuration Map
|
static java.lang.String |
getLastRequest()
Returns the last request sent to the Service
|
static java.lang.String |
getLastResponse()
Returns the last response returned by the Service
|
static OAuthTokenCredential |
getOAuthTokenCredential()
Returns OAuthTokenCredential instance using client ID and client secret loaded from configuration.
|
static OAuthTokenCredential |
initConfig(java.io.File file)
Initialize the system using a File(Properties file).
|
static OAuthTokenCredential |
initConfig(java.io.InputStream inputStream)
Initialize using
InputStream(of a Properties file).. |
static OAuthTokenCredential |
initConfig(java.util.Properties properties)
Initialize using Properties.
|
static void |
initializeToDefault()
Initialize to default properties
|
public static OAuthTokenCredential initConfig(java.io.File file) throws PayPalRESTException
file - File object of a properties entityPayPalRESTExceptionpublic static OAuthTokenCredential initConfig(java.util.Properties properties)
properties - Properties objectpublic static OAuthTokenCredential initConfig(java.io.InputStream inputStream) throws PayPalRESTException
InputStream(of a Properties file).. The system
is initialized using the given InputStream and if the
initialization succeeds the default 'sdk_config.properties' can only be
loaded by calling the method initializeToDefault(). The system is
initialized with the information after loading defaults for the
parameters that are not passed as part of the configuration. For defaults
see ConfigManagerinputStream - InputStreamPayPalRESTExceptionpublic static java.lang.String getClientID()
public static java.lang.String getClientSecret()
public static OAuthTokenCredential getOAuthTokenCredential()
public static void initializeToDefault()
throws PayPalRESTException
PayPalRESTExceptionpublic static java.lang.String getLastRequest()
public static java.lang.String getLastResponse()
public static java.util.Map<java.lang.String,java.lang.String> getConfigurations()
public static <T> T configureAndExecute(java.lang.String accessToken,
HttpMethod httpMethod,
java.lang.String resourcePath,
java.lang.String payLoad,
java.lang.Class<T> clazz)
throws PayPalRESTException
configureAndExecute(APIContext, HttpMethod, String, String, Class) instead.
Passing APIContext gives us better information than just raw access token.T - Response Type for de-serializationaccessToken - OAuth AccessToken to be used for the call.httpMethod - Http Method verbresourcePath - Resource URI pathpayLoad - Payload to Serviceclazz - Class object used in De-serializationPayPalRESTExceptionpublic static <T> T configureAndExecute(APIContext apiContext, HttpMethod httpMethod, java.lang.String resourcePath, java.lang.String payLoad, java.lang.Class<T> clazz) throws PayPalRESTException
T - Response Type for de-serializationapiContext - APIContext to be used for the call.httpMethod - Http Method verbresourcePath - Resource URI pathpayLoad - Payload to Serviceclazz - Class object used in De-serializationPayPalRESTExceptionpublic static <T> T configureAndExecute(APIContext apiContext, HttpMethod httpMethod, java.lang.String resourcePath, java.lang.String payLoad, java.lang.Class<T> clazz, java.lang.String accessToken) throws PayPalRESTException
T - Response Type for de-serializationapiContext - APIContext to be used for the call.httpMethod - Http Method verbresourcePath - Resource URI pathpayLoad - Payload to Serviceclazz - Class object used in De-serializationaccessToken - Access Token to be used instead of apiContextPayPalRESTExceptionpublic static <T> T configureAndExecute(APIContext apiContext, HttpMethod httpMethod, java.lang.String resourcePath, java.util.Map<java.lang.String,java.lang.String> headersMap, java.lang.String payLoad, java.lang.Class<T> clazz) throws PayPalRESTException
configureAndExecute(APIContext, HttpMethod, String, String, Class) instead. Headers could be passed directly
to #APIContext itself.T - apiContext - APIContext to be used for the call.httpMethod - Http Method verbresourcePath - Resource URI pathheadersMap - Optional headers MappayLoad - Payload to Serviceclazz - Class object used in De-serializationPayPalRESTExceptionpublic static APICallPreHandler createAPICallPreHandler(java.util.Map<java.lang.String,java.lang.String> configurationMap, java.lang.String payLoad, java.lang.String resourcePath, java.util.Map<java.lang.String,java.lang.String> headersMap, java.lang.String accessToken, java.lang.String requestId, SDKVersion sdkVersion)
APICallPreHandler for the underlying
layer.configurationMap - configuration MappayLoad - Raw payloadresourcePath - URI part of the resource operated onheadersMap - Custom HTTP headers mapaccessToken - OAuth TokenrequestId - PayPal Request IdsdkVersion - SDKVersion instancepublic static ClientCredentials getCredential()
public ClientCredentials getClientCredential()