diff --git a/src/main/java/com/paypal/core/Constants.java b/src/main/java/com/paypal/core/Constants.java index 3db802d..64f44a9 100644 --- a/src/main/java/com/paypal/core/Constants.java +++ b/src/main/java/com/paypal/core/Constants.java @@ -151,7 +151,7 @@ private Constants() {} public static final String IPN_SANDBOX_ENDPOINT = "https://www.sandbox.paypal.com/cgi-bin/webscr"; // IPN Live Endpoint - public static final String IPN_LIVE_ENDPOINT = "https://ipnpb.paypal.com/cgi-bin/websc"; + public static final String IPN_LIVE_ENDPOINT = "https://ipnpb.paypal.com/cgi-bin/webscr"; // Merchant Sandbox Endpoint Signature public static final String MERCHANT_SANDBOX_SIGNATURE_ENDPOINT = "https://api-3t.sandbox.paypal.com/2.0"; diff --git a/src/main/java/com/paypal/core/rest/OAuthTokenCredential.java b/src/main/java/com/paypal/core/rest/OAuthTokenCredential.java index a5c37aa..fdb25a0 100644 --- a/src/main/java/com/paypal/core/rest/OAuthTokenCredential.java +++ b/src/main/java/com/paypal/core/rest/OAuthTokenCredential.java @@ -74,7 +74,7 @@ public OAuthTokenCredential(String clientID, String clientSecret, /** * Computes Access Token by placing a call to OAuth server using ClientID * and ClientSecret. The token is appended to the token type. - * + * * @return the accessToken * @throws PayPalRESTException */ @@ -163,6 +163,24 @@ private HttpConfiguration getOAuthHttpConfiguration() { endPointUrl = Constants.REST_LIVE_ENDPOINT; } } + if (Boolean + .parseBoolean(configurationMap.get(Constants.USE_HTTP_PROXY))) { + httpConfiguration.setProxySet(true); + httpConfiguration.setProxyHost(configurationMap + .get(Constants.HTTP_PROXY_HOST)); + httpConfiguration.setProxyPort(Integer.parseInt(configurationMap + .get(Constants.HTTP_PROXY_PORT))); + + String proxyUserName = configurationMap + .get(Constants.HTTP_PROXY_USERNAME); + String proxyPassword = configurationMap + .get(Constants.HTTP_PROXY_PASSWORD); + + if (proxyUserName != null && proxyPassword != null) { + httpConfiguration.setProxyUserName(proxyUserName); + httpConfiguration.setProxyPassword(proxyPassword); + } + } endPointUrl = (endPointUrl.endsWith("/")) ? endPointUrl.substring(0, endPointUrl.length() - 1) : endPointUrl; endPointUrl += OAUTH_TOKEN_PATH;