avadev / AvaTax-REST-V2-PHP-SDK

Sales Tax API SDK for PHP and AvaTax REST
https://developer.avalara.com/sdk/
Apache License 2.0
48 stars 95 forks source link

Keep SDK version in constant and use it across requests #191

Closed Wirone closed 1 year ago

Wirone commented 1 year ago

I would like to suggest slight change of how this SDK passes its version in API calls. Currently Avalara\AvaTaxClientBase::restCall() has $apiversion argument which is used for creating X-Avalara-Client header. This method is used maaaaaany times in Avalara\AvaTaxClient, which is generated by AvaTax SDK process. It leads to huge diff where most of the changes are bumped version number in several restCall() calls.

It would be much better if Avalara\AvaTaxClient::SDK_VERSION was introduced, and then its value could be automatically updated by AvaTax SDK process. Then, in every restCall() this constant could be used instead of hardcoded value.

It would drastically improve each release's diff because only 1 line would be changed in terms of SDK version. It would allow people to get familiar only with actual changes in the SDK version.

svc-developer commented 1 year ago

I agree this is a good idea, I recently added a similar change for Typescript. I will add it to our backlog.

svc-developer commented 1 year ago

Should be fixed with release for 23.4.1