Skip to content
This repository was archived by the owner on Mar 15, 2024. It is now read-only.
This repository was archived by the owner on Mar 15, 2024. It is now read-only.

Possibility of using an http proxy #74

@lucuhb

Description

@lucuhb

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); <- this line
    $output = curl_exec($curl);
    curl_close($curl);
   return (string) $output;
}

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions