LexikPayboxBundle icon indicating copy to clipboard operation
LexikPayboxBundle copied to clipboard

Possibility of using an http proxy

Open lucuhb opened this issue 8 years ago • 0 comments

Hi, First, thanks for this bundle !

I have a problem with the bundle because my server should use an HTTP Proxy to go out and access the paybox server. Here is the error : "Warning: DOMDocument::loadHTML(): Empty string supplied as input" in vendor/lexik/paybox-bundle/Paybox/AbstractRequest.php at line 152

To access to the paybox server, a new curl option CURLOPT_PROXY should be added in the getWebPage function of AbstractRequest.php, like this :

 protected function getWebPage($url)    {
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL,            $url);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); 
    curl_setopt($curl, CURLOPT_HEADER,         false);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); 
    curl_setopt($curl, CURLOPT_PROXY,'xxx.xxxx.xxx.xx:port' true); 

Is it possible to add new parameters in configuration of this bundle to define the IP address of the HTTP proxy and its port and, if they are defined , add the necessary line in getWebPage function?

Thanks

lucuhb avatar Jun 28 '16 09:06 lucuhb