public class AmazonPayClient extends Object
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.http.impl.conn.PoolingHttpClientConnectionManager |
connectionManager |
protected PayConfiguration |
payConfiguration |
protected RequestSigner |
requestSigner |
| Constructor and Description |
|---|
AmazonPayClient(PayConfiguration payConfiguration) |
| Modifier and Type | Method and Description |
|---|---|
AmazonPayResponse |
callAPI(URI uri,
String httpMethodName,
Map<String,List<String>> queryParameters,
String request,
Map<String,String> header)
API to process the request and return the
|
AmazonPayResponse |
deleteAmazonPayAccount(String merchantAccountId) |
AmazonPayResponse |
deleteAmazonPayAccount(String merchantAccountId,
Map<String,String> header)
Deletes the Merchant account for the given Merchant Account ID.
|
AmazonPayResponse |
deliveryTracker(org.json.JSONObject payload)
The Delivery Tracker operation is used to track the delivery status
|
AmazonPayResponse |
deliveryTracker(org.json.JSONObject payload,
Map<String,String> header)
The Delivery Tracker operation is used to track the delivery status
|
String |
generateButtonSignature(org.json.JSONObject payload)
generateButtonSignature is a convenience method to assist the developer in generating static signatures
that can be used by Checkout v2's amazon.Pay.renderButton method.
|
String |
generateButtonSignature(String payload)
generateButtonSignature is a convenience method to assist the developer in generating static signatures
that can be used by Checkout v2's amazon.Pay.renderButton method.
|
AmazonPayResponse |
getAuthorizationToken(String mwsAuthToken,
String merchantId,
Map<String,String> header)
The get Authorization Token operation is used to obtain retrieve a delegated authorization token
used in order to make API calls on behalf of a merchant.
|
protected org.apache.http.impl.client.CloseableHttpClient |
getClosableHttpClientWithConnectionPool()
Returns the CloseableHttpClient object with Connection Pool based on the Payconfiguration
|
protected org.apache.http.impl.client.CloseableHttpClient |
getClosableHttpClientWithPoolAndProxy()
Returns the CloseableHttpClient object with Connection Pool based on the given proxy settings.
|
ConnectionPoolStats |
getPoolStats()
Helper function to retrieve the Connection Pool Stats to the caller to monitor the Connection Pool Performance
|
AmazonPayResponse |
registerAmazonPayAccount(org.json.JSONObject payload) |
AmazonPayResponse |
registerAmazonPayAccount(org.json.JSONObject payload,
Map<String,String> header)
Creates a non-logginable account for your merchant partners.
|
AmazonPayResponse |
updateAmazonPayAccount(String merchantAccountId,
org.json.JSONObject payload) |
AmazonPayResponse |
updateAmazonPayAccount(String merchantAccountId,
org.json.JSONObject payload,
Map<String,String> header)
Updates a merchant account for the given Merchant Account ID.
|
protected final PayConfiguration payConfiguration
protected final RequestSigner requestSigner
protected final org.apache.http.impl.conn.PoolingHttpClientConnectionManager connectionManager
public AmazonPayClient(PayConfiguration payConfiguration) throws AmazonPayClientException
AmazonPayClientExceptionpublic AmazonPayResponse deliveryTracker(org.json.JSONObject payload, Map<String,String> header) throws AmazonPayClientException
payload - JSONObject request bodyheader - Map<String, String> containining key-value pair of required headers (e.g., keys such as x-amz-pay-idempotency-key, x-amz-pay-authtoken)AmazonPayClientException - When an error response is returned by Amazon Pay due to bad request or other issuepublic AmazonPayResponse getAuthorizationToken(String mwsAuthToken, String merchantId, Map<String,String> header) throws AmazonPayClientException
mwsAuthToken - MWS Authorization Token previously shared by Merchant to the Solution ProvidermerchantId - Merchant ID that generated the MWS Authorization Tokenheader - Map<String, String> containining key-value pair of required headers (e.g., keys such as x-amz-pay-idempotency-key, x-amz-pay-authtoken)AmazonPayClientException - When an error response is returned by Amazon Pay due to bad request or other issueAmazonPayClient,
PayConfiguration,
Environmentpublic AmazonPayResponse deliveryTracker(org.json.JSONObject payload) throws AmazonPayClientException
payload - JSONObject request bodyAmazonPayClientException - When an error response is returned by Amazon Pay due to bad request or other issuepublic String generateButtonSignature(org.json.JSONObject payload) throws AmazonPayClientException
payload - The payloadJSON attribute from createCheckoutSessionConfig object used by amazon.Pay.renderButton method from checkout.jsAmazonPayClientException - When an error response is returned by Amazon Pay due to bad request or other issuepublic String generateButtonSignature(String payload) throws AmazonPayClientException
payload - The payloadJSON attribute from createCheckoutSessionConfig object used by amazon.Pay.renderButton method from checkout.jsAmazonPayClientException - When an error response is returned by Amazon Pay due to bad request or other issuepublic AmazonPayResponse callAPI(URI uri, String httpMethodName, Map<String,List<String>> queryParameters, String request, Map<String,String> header) throws AmazonPayClientException
uri - The uri that needs to be executedhttpMethodName - the HTTP request method(GET,PUT,POST etc) to be usedqueryParameters - the query parameters maprequest - the payload to be sent with the requestheader - the header of the solution providerAmazonPayClientException - When an error response is returned by Amazon Pay due to bad request or other issuepublic ConnectionPoolStats getPoolStats()
protected org.apache.http.impl.client.CloseableHttpClient getClosableHttpClientWithConnectionPool()
protected org.apache.http.impl.client.CloseableHttpClient getClosableHttpClientWithPoolAndProxy()
public AmazonPayResponse registerAmazonPayAccount(org.json.JSONObject payload, Map<String,String> header) throws AmazonPayClientException
payload - JSONObject request bodyheader - Map<String, String> containing key-value pair of required headers (e.g., keys such as x-amz-pay-idempotency-key, x-amz-pay-authtoken).AmazonPayClientException - When an error response is returned by Amazon Pay due to bad request or other issue.public AmazonPayResponse registerAmazonPayAccount(org.json.JSONObject payload) throws AmazonPayClientException
AmazonPayClientExceptionpublic AmazonPayResponse updateAmazonPayAccount(String merchantAccountId, org.json.JSONObject payload, Map<String,String> header) throws AmazonPayClientException
merchantAccountId - Internal Merchant Account ID provided while calling the API.payload - JSONObject request bodyheader - Map<String, String> containing key-value pair of required headers (e.g., keys such as x-amz-pay-idempotency-key, x-amz-pay-authtoken).AmazonPayClientException - When an error response is returned by Amazon Pay due to bad request or other issue.public AmazonPayResponse updateAmazonPayAccount(String merchantAccountId, org.json.JSONObject payload) throws AmazonPayClientException
AmazonPayClientExceptionpublic AmazonPayResponse deleteAmazonPayAccount(String merchantAccountId, Map<String,String> header) throws AmazonPayClientException
merchantAccountId - Internal Merchant Account ID provided while calling the API.header - Map<String, String> containing key-value pair of required headers (e.g., keys such as x-amz-pay-idempotency-key, x-amz-pay-authtoken).AmazonPayClientException - When an error response is returned by Amazon Pay due to bad request or other issue.public AmazonPayResponse deleteAmazonPayAccount(String merchantAccountId) throws AmazonPayClientException
AmazonPayClientExceptionCopyright © 2024. All rights reserved.