Releases: spaze/vat-calculator
End of support
(This is the same release notes as in 4.0.4 but in 3.6.x series which still seems to be used by some folks even after almost a year after I've EOL'd this.)
I'm no longer using the library, have migrated to Stripe Checkout and Stripe Tax and moved on and as such
I will no longer maintain the library.
I'm not sure what would be the best way to do this but I just didn't want to abandon it like that so I'm making this a new major release so there's a chance you'll read this :-) Otherwise there are no (real) changes. This repository will be available at least until end of 2023 but
there will be no new releases.
This version will start throwing notices which will be upgraded to warnings in January 2024 because some rates may change and it may be dangerous pricing-wise to use this library.
Going forward there are 2 options for you:
Let me know if you want to maintain the library, I'll transfer the repoSee 2.- Move back to https://github.com/driesvints/vat-calculator by @driesvints (recommended)
Use https://github.com/JakubJachym/vat-calculator by @JakubJachym (recommended if you want features from this fork which the original doesn't have)doesn't seem to keep the VAT rates up to date
Thank you 🙏
End of support
I'm no longer using the library, have migrated to Stripe Checkout and Stripe Tax and moved on and as such
I will no longer maintain the library.
I'm not sure what would be the best way to do this but I just didn't want to abandon it like that so I'm making this a new major release so there's a chance you'll read this :-) Otherwise there are no (real) changes. This repository will be available at least until end of 2023 but
there will be no new releases.
This version will start throwing notices which will be upgraded to warnings in January 2024 because some rates may change and it may be dangerous pricing-wise to use this library.
Going forward there are 2 options for you:
Let me know if you want to maintain the library, I'll transfer the repoSee 2.- Move back to https://github.com/driesvints/vat-calculator by @driesvints (recommended)
Use https://github.com/JakubJachym/vat-calculator by @JakubJachym (recommended if you want features from this fork which the original doesn't have)doesn't seem to keep the VAT rates up to date
Thank you 🙏
What's Changed
- Start testing on PHP 8.2 (#39)
Full Changelog: v3.6.5...v4.0.4
Timeout
You can now specify a timeout for online VAT number check using VIES, in VatCalculator::__construct
's float $timeout
parameter. If not specified, PHP's default_socket_timeout
is used which defaults to 60 seconds.
Campione d'Italia: correct VAT and postal code
Remove GB from EU countries
Removes GB from EU countries, because VIES validation now throws errors. You can added GB back manually with addRateForCountry()
if you want to calculate VAT but tax id validation won't be done using the VIES service.
PHP 8 support
PHP 8.0 is now supported.
No other user-facing changes in this release.
Get all known rates
- New method
VatRates::getAllKnownRates()
to get all known rates for a country - Can specify
$businessCountryCode
and$businessVatNumber
inVatCalculator
's constructor, no need to callsetBusinessCountryCode()
orsetBusinessVatNumber()
throw new InvalidCharsInVatNumberException;
This release adds a new exception when you pass invalid characters for VAT number validation. Previously, such VAT number was sent for validation but came back as invalid.
InvalidCharsInVatNumberException
thrown when the VAT number to be validated contains invalid (e.g. non-latin) characters, use$e->getInvalidChars()
to get the chars and their offset as array (#20)- Abstract base exception class
VatNumberException
for VAT number-related failures - Move phpstan/phpstan to dev dependencies only, it's not required for or by the lib itself
- Auto code checking with linter, code sniffer (#18)
https://UnsupportedCountryException
- When trying to get details of a VAT id from a non-EU country (
getVatDetails()
or ,UnsupportedCountryException
is now thrown, previouslyVatCheckUnavailableException
was thrown (#13) - VIES WSDL is now loaded over HTTPS, the server was issuing a redirect to HTTPS anyway (#15)
- New method
shouldCollectEuVat()
that returnstrue
only for EU member states,shouldCollectVat()
also returnstrue
for countries added manually withaddRateForCountry()
(#13 again)
More non-EU countries removed
Some countries that are not part of the EU also use VAT. But if you're in EU, you don't always want to charge VAT when selling to such countries so these countries have been removed from the default config. You can add TR and CH back with VatRates::addRateForCountry()
. This is similar to Norway, that has been removed in release 3.1.0. (#11)
Static analysis using the wonderful PHPStan (#12).