public class Util extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_ENCODING |
static String |
JAVA_VERSION |
static String |
OS_NAME |
static String |
OS_VERSION |
| Constructor and Description |
|---|
Util() |
| Modifier and Type | Method and Description |
|---|---|
static PrivateKey |
buildPrivateKeyFromString(String privateKeyString)
Builds the PrivateKey object fromt the private key string provided
|
static long |
getExponentialWaitTime(int retryCount)
Returns the next wait interval, in milliseconds, using an exponential
backoff algorithm.
|
static String |
getFormattedTimestamp()
Generates the current time stamp in "yyyyMMdd'T'HHmmss'Z'" format
|
static URI |
getServiceURI(PayConfiguration payConfiguration,
String action)
To get the service URI
|
static String |
lowerCase(String str)
Generates a lower case string from the given string
|
static Map<String,String> |
updateHeader(Map<String,String> header)
Returns the header with idempotency key, if not provided by the Merchant.
|
static String |
urlEncode(String value,
boolean path)
Generates a url encoded string from the given string
|
public static final String JAVA_VERSION
public static final String OS_NAME
public static final String OS_VERSION
public static final String DEFAULT_ENCODING
public static String urlEncode(String value, boolean path) throws AmazonPayClientException
value - the string to be encodedpath - to determine if the given value is a string or notAmazonPayClientException - When an error response is returned by Amazon Pay due to bad request or other issuepublic static String lowerCase(String str)
str - the string to be convertedpublic static String getFormattedTimestamp()
public static PrivateKey buildPrivateKeyFromString(String privateKeyString) throws AmazonPayClientException
privateKeyString - the private key string providedAmazonPayClientException - When an error response is returned by Amazon Pay due to bad request or other issuepublic static URI getServiceURI(PayConfiguration payConfiguration, String action) throws AmazonPayClientException
payConfiguration - the PayConfiguration objectaction - the action to be performed by the requestAmazonPayClientException - When an error response is returned by Amazon Pay due to bad request or other issuepublic static long getExponentialWaitTime(int retryCount)
retryCount - The current retry countCopyright © 2020. All rights reserved.