forked from LiveCarta/PayPal-PHP-SDK
Make Proxy Configuration Work (#902)
Proxy setting were not being respected, so once is returned, setHttpProxy() is called to add the proxy option if need prior to getting and OAuth token or executing a call to PayPal
This commit is contained in:
@@ -226,6 +226,11 @@ class OAuthTokenCredential extends PayPalResourceModel
|
|||||||
{
|
{
|
||||||
$httpConfig = new PayPalHttpConfig(null, 'POST', $config);
|
$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);
|
$handlers = array(self::$AUTH_HANDLER);
|
||||||
|
|
||||||
/** @var IPayPalHandler $handler */
|
/** @var IPayPalHandler $handler */
|
||||||
|
|||||||
@@ -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 */
|
/** @var \Paypal\Handler\IPayPalHandler $handler */
|
||||||
foreach ($handlers as $handler) {
|
foreach ($handlers as $handler) {
|
||||||
if (!is_object($handler)) {
|
if (!is_object($handler)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user