public interface IApiManagement extends IIngenicoApi
Example:
IApiManagement
apiManagement = ApiManagement.getInstance(context);
try {
// Replace "mysecretkey" with your initial token for API management
apiManagement.subscribe("mysecretkey");
} catch (IngenicoException e) {
// Handle exception
}
Modifier and Type | Method and Description |
---|---|
ApiManagementToken |
getUsageToken()
Deprecated.
Since version 2.12.0, this method will always throw an exception.
|
long |
subscribe(java.lang.String apiKey)
Request a new token and register it for API usage.
|
long |
subscribe(java.lang.String apiKey,
boolean forceRenewal)
Request a new token and register it for API usage.
|
long |
subscribe(java.lang.String apiKey,
java.lang.String isvRecord)
Request a new token and register it for API usage.
|
long |
subscribe(java.lang.String apiKey,
java.lang.String isvRecord,
boolean forceRenewal)
Request a new token and register it for API usage.
|
connect, disconnect, isConnected
long subscribe(java.lang.String apiKey) throws IngenicoException
This method make network requests and can be blocking, it must NOT be called from the main thread.
apiKey
- the secret authenticating the registered right to use the API setIngenicoException
- errors subscribing to the API management, see message for detailslong subscribe(java.lang.String apiKey, java.lang.String isvRecord) throws IngenicoException
This method make network requests and can be blocking, it must NOT be called from the main thread.
apiKey
- the secret authenticating the registered right to use the API setisvRecord
- an ISV defined record (json) containing detailed information on its
application installation and configuration (this information can be used
later to associate the token request to ISV own billing system).IngenicoException
- errors subscribing to the API management, see message for detailslong subscribe(java.lang.String apiKey, boolean forceRenewal) throws IngenicoException
This method make network requests and can be blocking, it must NOT be called from the main thread.
If forceRenewal is true, a new usage token with an updated expiration date will be requested on the token server. If false, the previous token is reused if not expired, or a new token will be requested.
apiKey
- the secret authenticating the registered right to use the API setforceRenewal
- set true to ensure the renewal of the existing tokenIngenicoException
- errors subscribing to the API management, see message for detailslong subscribe(java.lang.String apiKey, java.lang.String isvRecord, boolean forceRenewal) throws IngenicoException
This method make network requests and can be blocking, it must NOT be called from the main thread.
If forceRenewal is true, a new usage token with an updated expiration date will be requested on the token server. If false, the previous token is reused if not expired, or a new token will be requested.
apiKey
- the secret authenticating the registered right to use the API setisvRecord
- an ISV defined record (json) containing detailed information on its
application installation and configuration (this information can be used
later to associate the token request to ISV own billing system)forceRenewal
- set true to ensure the renewal of the existing tokenIngenicoException
- errors subscribing to the API management, see message for details@Deprecated ApiManagementToken getUsageToken() throws IngenicoException
IngenicoException