src/AvaTaxClient.php
/**
     * Make a single REST call to the AvaTax v2 API server
     *
     * @param string $apiUrl           The relative path of the API on the server
     * @param string $verb             The HTTP verb being used in this request
     * @param string $guzzleParams     The Guzzle parameters for this request, including query string and body parameters
     */
Make a single REST call to the AvaTax v2 API server
@param string $apiUrl           The relative path of the API on the server
@param string $verb             The HTTP verb being used in this request
@param string $guzzleParams     The Guzzle parameters for this request, including query string and body parameters
Make a single REST call to the AvaTax v2 API server @param string $apiUrl The relative path of the API on the server @param string $verb The HTTP verb being used in this request @param string $guzzleParams The Guzzle parameters for this request including query string and body parameters
private function restCall($apiUrl, $verb, $guzzleParams)
    {
        if (!isset($guzzleParams['auth'])){
            $guzzleParams['auth'] = $this->auth;
        }
        $guzzleParams['headers'] = [
            'Accept' => 'application/json',
            'X-Avalara-Client' => "{$this->appName}; {$this->appVersion}; PhpRestClient; 17.5.0-67; {$this->machineName}"
        ];
        try {
            $response = $this->client->request($verb, $apiUrl, $guzzleParams);
            $body = $response->getBody();
            return json_decode($body);
        } catch (\Exception $e) {
            return $e->getMessage();
        }
    }
private function restCall ( $ apiUrl , $ verb , $ guzzleParams ) { if ( ! isset ( $ guzzleParams [ 'auth' ] ) ) { $ guzzleParams [ 'auth' ] = $ this -> auth ; } $ guzzleParams [ 'headers' ] = [ 'Accept' => 'application/json' , 'X-Avalara-Client' => " { $ this -> appName } ;  { $ this -> appVersion } ; PhpRestClient; 17.5.0-67;  { $ this -> machineName } " ] ; try { $ response = $ this -> client -> request ( $ verb , $ apiUrl , $ guzzleParams ) ; $ body = $ response -> getBody ( ) ; return json_decode ( $ body ) ; } catch ( \ Exception $ e ) { return $ e -> getMessage ( ) ; } }
Make a single REST call to the AvaTax v2 API server
 @param string $apiUrl           The relative path of the API on the server
 @param string $verb             The HTTP verb being used in this request
 @param string $guzzleParams     The Guzzle parameters for this request, including query string and body parameters
Make a single REST call to the AvaTax v2 API server @param string $apiUrl The relative path of the API on the server @param string $verb The HTTP verb being used in this request @param string $guzzleParams The Guzzle parameters for this request including query string and body parameters
// Set authentication on the parameters // Contact the server