Skip to content
This repository has been archived by the owner on Oct 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #16 from spaze/spaze/https-vies-wsdl
Browse files Browse the repository at this point in the history
HTTPS VIES WSDL OMG BBQ
  • Loading branch information
spaze authored Sep 10, 2020
2 parents 07d9d63 + 07ea000 commit e0f9a7a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ if ($vatCalculator->shouldCollectVat('DE')) {
```

To validate your customers VAT numbers, you can use the `isValidVatNumber` method.
The VAT number should be in a format specified by the [VIES](http://ec.europa.eu/taxation_customs/vies/faqvies.do#item_11).
The VAT number should be in a format specified by the [VIES](https://ec.europa.eu/taxation_customs/vies/faqvies.do#item_11).
The given VAT numbers will be truncated and non relevant characters / whitespace will automatically be removed.

This service relies on a third party SOAP API provided by the EU. If, for whatever reason, this API is unavailable a `VatCheckUnavailableException` will be thrown.
Expand All @@ -117,7 +117,7 @@ try {
### Get EU VAT number details

To get the details of a VAT number, you can use the `getVatDetails` method.
The VAT number should be in a format specified by the [VIES](http://ec.europa.eu/taxation_customs/vies/faqvies.do#item_11).
The VAT number should be in a format specified by the [VIES](https://ec.europa.eu/taxation_customs/vies/faqvies.do#item_11).
The given VAT numbers will be truncated and non relevant characters / whitespace will automatically be removed.

This service relies on a third party SOAP API provided by the EU. If, for whatever reason, this API is unavailable a `VatCheckUnavailableException` will be thrown.
Expand Down
1 change: 1 addition & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* Some methods have been properly *camelCased*: methods like `getClientIP()` -> `getClientIp()` and `shouldCollectVAT` -> `shouldCollectVat` and a few more
* `VATCheckUnavailableException` has been *camelCased* to `VatCheckUnavailableException`
* If a VAT number from a unsupported/non-EU country is provided for validation or for `getVatDetails()` call, `UnsupportedCountryException` will be thrown
* VIES WSDL is now loaded over HTTPS, if you hit issues you should update your system's list of trusted CAs, or install [composer/ca-bundle](https://github.com/composer/ca-bundle), use it [with PHP streams](https://github.com/composer/ca-bundle#to-use-with-php-streams), create your own `SoapClient` instance with `stream_context` option (`new SoapClient(self::VAT_SERVICE_URL, ['stream_context' => $context])`) and use `VatCalculator::setSoapClient()` to use the custom client
* Requires PHP 7.3

# Upgrading from 1.* to 2.*
Expand Down
2 changes: 1 addition & 1 deletion src/VatCalculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class VatCalculator
*
* @var string
*/
const VAT_SERVICE_URL = 'http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl';
const VAT_SERVICE_URL = 'https://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl';

/** @var SoapClient */
private $soapClient;
Expand Down
2 changes: 1 addition & 1 deletion src/VatRates.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class VatRates
/**
* All available tax rules and their exceptions.
*
* Taken from: http://ec.europa.eu/taxation_customs/resources/documents/taxation/vat/how_vat_works/rates/vat_rates_en.pdf
* Taken from: https://ec.europa.eu/taxation_customs/resources/documents/taxation/vat/how_vat_works/rates/vat_rates_en.pdf
*
* @var array<string, array{rate: float, rates?: array, exceptions?: array, since?: array}>
*/
Expand Down

0 comments on commit e0f9a7a

Please sign in to comment.