diff --git a/lib/PayPal/Auth/OAuthTokenCredential.php b/lib/PayPal/Auth/OAuthTokenCredential.php index 949fb86..d142aa0 100644 --- a/lib/PayPal/Auth/OAuthTokenCredential.php +++ b/lib/PayPal/Auth/OAuthTokenCredential.php @@ -226,6 +226,11 @@ class OAuthTokenCredential extends PayPalResourceModel { $httpConfig = new PayPalHttpConfig(null, 'POST', $config); + // if proxy set via config, add it + if (!empty($config['http.Proxy'])) { + $httpConfig->setHttpProxy($config['http.Proxy']); + } + $handlers = array(self::$AUTH_HANDLER); /** @var IPayPalHandler $handler */ diff --git a/lib/PayPal/Transport/PayPalRestCall.php b/lib/PayPal/Transport/PayPalRestCall.php index f9edf03..a505959 100644 --- a/lib/PayPal/Transport/PayPalRestCall.php +++ b/lib/PayPal/Transport/PayPalRestCall.php @@ -61,6 +61,11 @@ class PayPalRestCall ) ); + // if proxy set via config, add it + if (!empty($config['http.Proxy'])) { + $httpConfig->setHttpProxy($config['http.Proxy']); + } + /** @var \Paypal\Handler\IPayPalHandler $handler */ foreach ($handlers as $handler) { if (!is_object($handler)) {