SlimPay / hapiclient-php

HAPI Client for PHP.
MIT License
14 stars 12 forks source link

Limited Config #13

Open yagami271 opened 5 years ago

yagami271 commented 5 years ago

Hello, when i see https://github.com/SlimPay/hapiclient-php/blob/master/src/Http/HapiClient.php the constructor of HapiClient call the client's custructor, so you cant add spécific configuration for Client

public function __construct(
            $apiUrl = null,
            $entryPointUrl = '/',
            $profile = null,
            AuthenticationMethod $authenticationMethod = null)
    {
        $this->apiUrl = trim($apiUrl);
        $this->entryPointUrl = trim($entryPointUrl);
        $this->profile = trim($profile);
        $this->authenticationMethod = $authenticationMethod;

        if ($this->apiUrl) {
            $baseUrl = rtrim($this->apiUrl, '/') . '/';

            if (Misc::isGuzzle6()) {

                $this->client = new Client(['base_uri' => $baseUrl,'proxy'=>'XX.XX.XXX.XX:XXXXX']);
            } else {
                $this->client = new Client(['base_url' => $baseUrl]);
            }
        } else {
            $this->client = new Client();
        }
    }