avadev / AvaTax-Calc-REST-PHP

PHP sample for the AvaTax Calc REST API
Apache License 2.0
9 stars 28 forks source link

Class 'AvaTax\Exception' not found in /libraries/AvaTax/TaxServiceRest.php on line 117 #24

Closed abhisheksrivastav closed 9 years ago

abhisheksrivastav commented 9 years ago

Any help is appreciated. I have integrated Avalara tax api in to system but at time of making ping test call I am getting the below error -- "Class 'AvaTax\Exception' not found in /libraries/AvaTax/TaxServiceRest.php on line 117 "

// $serviceURL = $configuration['serviceURL']; $accountNumber = $configuration['accountNumber']; $licenseKey = $configuration['licenseKey']; $taxSvc = new AvaTax\TaxServiceRest($serviceURL, $accountNumber, $licenseKey);

    $geoTaxResult = $taxSvc->ping(""); 
    echo '<pre>';
    print_r($geoTaxResult);
    die;
    echo 'PingTest Result: ' . $geoTaxResult->getResultCode()."\n";
    if($geoTaxResult->getResultCode() != AvaTax\SeverityLevel::$Success)
    {   
        foreach($geoTaxResult->getMessages() as $message)
        {
            echo $message->getSummary() . "\n";
        }
    }

As I can see there is no AvaTax\Exception lying inside library, let me know from where I can get this class.

Thanks, Abhishek

anyarms commented 9 years ago

Looks like the Exception wasn't specifying the namespace correctly. Fixed, try updating the core classes now. As an added note: the exception it was trying to throw was "A valid service URL is required.", so you might check to make sure that you have valid data in your configuration.php file as well.

abhisheksrivastav commented 9 years ago

Basically I was needing this exception handling , as there is need of functionality to test connection to get certified the AVATAX system, in case if any of credentials or any anything goes wrong in that case exception to be thrown, Although i will update the core classes and if any issue seems will let you know again.

Thanks for your response over this thread