Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proxy configuration #92

Closed
wants to merge 2 commits into from
Closed

Conversation

coreykck
Copy link

Add getter and setter to Configuration Class and get the proxy to configure curl option.
You must pass the proxy as "host:port"

@napolux
Copy link

napolux commented Aug 13, 2015

THIS IS JUST WHAT I NEED! PLEASE INTEGRATE!

@coreykck
Copy link
Author

Tnx a lot napolux,
That's one small step for a man, a giant leap for mankind
Il 13/ago/2015 18:10, "Napolux" notifications@github.com ha scritto:

THIS IS JUST WHAT I NEED! PLEASE INTEGRATE!


Reply to this email directly or view it on GitHub
#92 (comment)
.

@reenl
Copy link

reenl commented Aug 28, 2015

Need this 👍

@wjr1985
Copy link

wjr1985 commented Aug 28, 2015

Hey @coreykck, @napolux, and @reenl,

Thanks for bringing this up! Just to update you, we are planning on implementing proxy configuration functionality into our client library. We'll keep you posted as to when it will be available.

@@ -131,6 +131,11 @@ public function _doUrlRequest($httpVerb, $url, $requestBody = null)
curl_setopt($curl, CURLOPT_POSTFIELDS, $requestBody);
}

if (!empty($this->_config->getProxy())) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prior to PHP version 5.5 this will result in the following error:
Can't use method return value in write context

@coreykck
Copy link
Author

Changed according to the comments. Tnx a lot

@wjr1985
Copy link

wjr1985 commented Oct 26, 2015

Hi @coreykck, @napolux, and @reenl,

We now support proxy configuration in our PHP library. To use it, you can specify the proxy in a similar way to how you configure your merchant ID, public key, and private key:

Braintree_Configuration::proxyHost('https://localhost');
Braintree_Configuration::proxyPort('8089');

If you want to specify the type of proxy (cURL's CURLOPT_PROXYTYPE), you can specify it by setting Braintree_Configuration::proxyType(). For example, if you're using a SOCKS5 proxy with a hostname, it would be Braintree_Configuration::proxyType(CURLPROXY_SOCKS5_HOSTNAME);

Official documentation is forthcoming, however this should be enough to get you started. If you run into any problems along the way feel free to open an issue.

@wjr1985 wjr1985 closed this Oct 26, 2015
@coreykck
Copy link
Author

Tnx a lot bill.
Ciao
Corrado
Il 26/ott/2015 21:51, "Bill Rastello" notifications@github.com ha scritto:

Hi @coreykck https://github.com/coreykck, @napolux
https://github.com/napolux, and @reenl https://github.com/reenl,

We now support proxy configuration in our PHP library. To use it, you can
specify the proxy in a similar way to how you configure your merchant ID,
public key, and private key:

Braintree_Configuration::proxyHost('https://localhost');
Braintree_Configuration::proxyPort('8089');

If you want to specify the type of proxy (cURL's CURLOPT_PROXYTYPE), you
can specify it by setting Braintree_Configuration::proxyType(). For
example, if you're using a SOCKS5 proxy with a hostname, it would be
Braintree_Configuration::proxyType(CURLPROXY_SOCKS5_HOSTNAME);

Official documentation is forthcoming, however this should be enough to
get you started. If you run into any problems along the way feel free to
open an issue.


Reply to this email directly or view it on GitHub
#92 (comment)
.

@napolux
Copy link

napolux commented Oct 27, 2015

Cool!

Il giorno 26 ott 2015, alle ore 21:51, Bill Rastello notifications@github.com ha scritto:

Hi @coreykck, @napolux, and @reenl,

We now support proxy configuration in our PHP library. To use it, you can specify the proxy in a similar way to how you configure your merchant ID, public key, and private key:

Braintree_Configuration::proxyHost('https://localhost');
Braintree_Configuration::proxyPort('8089');

If you want to specify the type of proxy (cURL's CURLOPT_PROXYTYPE), you can specify it by setting Braintree_Configuration::proxyType(). For example, if you're using a SOCKS5 proxy with a hostname, it would be Braintree_Configuration::proxyType(CURLPROXY_SOCKS5_HOSTNAME);

Official documentation is forthcoming, however this should be enough to get you started. If you run into any problems along the way feel free to open an issue.


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants