Giter VIP home page Giter VIP logo

vat's People

Contributors

bpolaszek avatar brekitomasson avatar coenjacobs avatar dannyvankooten avatar dennisoderwald avatar dixonl90 avatar franmomu avatar gemal avatar holtkamp avatar jarlskov avatar kilbourne avatar malengrin avatar marcsollie avatar mixislv avatar peter279k avatar simonevallana avatar swop avatar uldisn avatar vincentlanglet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vat's Issues

Embedding your lib into a WP plugin

Hi, i embedded your lib in a plugin and it works perfectly, but one of my users gets the following error, which seem to be linked to your code:

[08-Apr-2018 13:05:09 UTC] PHP Fatal error:  Uncaught Error: Class 'SoapClient' not found in /var/www/html/illustration.tools/public_html/wp-content/plugins/rcp-vat/libs/vendor/dannyvankooten/vat.php/src/Vies/Client.php:63
Stack trace:
#0 /var/www/html/illustration.tools/public_html/wp-content/plugins/rcp-vat/libs/vendor/dannyvankooten/vat.php/src/Vies/Client.php(44): DvK\Vat\Vies\Client->getClient()
#1 /var/www/html/illustration.tools/public_html/wp-content/plugins/rcp-vat/libs/vendor/dannyvankooten/vat.php/src/Validator.php(93): DvK\Vat\Vies\Client->checkVat('39', '281928M')
#2 /var/www/html/illustration.tools/public_html/wp-content/plugins/rcp-vat/admin/class-rcp-vat-admin.php(666): DvK\Vat\Validator->validateExistence('39281928M')
#3 /var/www/html/illustration.tools/public_html/wp-content/plugins/rcp-vat/admin/class-rcp-vat-admin.php(724): Rcp_Vat_Admin->validateUserFields(Array, 'register')
#4 /var/www/html/illustration.tools/public_html/wp-includes/class-wp-hook.php(286): Rcp_Vat_Admin->rcp_vat_rcp_validate_user_fields_on_register(Array)
#5 /var/w in /var/www/html/illustration.tools/public_html/wp-content/plugins/rcp-vat/libs/vendor/dannyvankooten/vat.php/src/Vies/Client.php on line 63```

Any idea ?
Thanks

UK/GB Vat number support

As of 01/01/2021 (Brexit) the Vies validator no longer supports GB VAT numbers.

Currently this library still supports validateVatNumberFormat('GB000000000') as true, but running validate on any GB code throws a ViesException of invalid input.

There is a (new) API from the UK here - Would you be open to a PR that added support for GB numbers using this or do you want to stay EU/Vies specific?

if a VAT does not exists in VIES it does not mean it does not exist

Just something I learned today, VIES only manages VAT numbers where the company has to pay VAT. For example Doctors or Libraries in Belgium don't have to pay VAT, but they have a VAT number. However you won't find those VAT numbers on VIES.

So I think the method name "validateExistence()" is not 100% accurate.

besides that: thanks for this library!

Current PHP version requirements

As title, according to the .travis.yml file, it only tests for php-7.3 and php-7.4 versions.

When looking at the composer.json file, it requires php-7.1 version at least.

What's the PHP versions requirements currently? If this package requires php-7.1 and php-7.2, it should add above PHP version tests during Travis CI building.

Otherwise, it should modify the composer.json and using the >=7.3 to let this package require php-7.3 version at least.

Once this issue is accepted by repository owner, I will be happy to work on this.

"inEurope" is confusing

Hi, I would suggest renaming the functions, your "$countries->inEurope()" lists countries in EU, not in Europe - I mean, Switzerland is in Europe but not in EU. It's bit confusing and the code is not easily readable. However, thanks for a great plugin!

add hasPattern to Validator

being able to check if here is a pattern for a country would it possible to add fx VAT number format check for Norway

so I could first do a check for "hasPattern" and then call the validateVatNumberFormat if hasPattern returned true

Today all numbers from Norway return false due to this check:

        if (! isset($this->patterns[$country])) {
            return false;
        }

Format

By giving a country code and business id, a function could return a VAT ID formatted to international format.

Examples:

format('FI', '1234567-1') would return FI12345671
format('SE', '556697-6009') would return SE556697600901

PHP version

Composer requires php >= 7.0 but documentation says it is supported by PHP 5.6+.
Haven't tested compatibility yet.

CURL Refresh Fails

This could just be my setup but I was getting failure when

IbericodeVatRatesClient fetch() was being called. Returning an empty body and no status code. Throwing an exception preventing all other code doing-the-do.

Had to add in curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,FALSE); to get it to work, not ideal as a temp mod to the main library... but might be an cert issue on the HTTPS for https://raw.githubusercontent.com/ibericode/vat-rates/master/vat-rates.json that needs resolving? Or could be something else but this fixed it for me.

ip2country.info is dead?

Looks like ip2country.info is now ipapi.com and requires an API key to be used. I think we should follow suit and add a provider for that.

Always Invalid country code when trying to get rates

I'm trying to grab VAT rates for specific countries but i always get the error:

Invalid country code "country"

What i'm doing:

     $rates = new Rates($_SERVER["DOCUMENT_ROOT"].'assets/vat.txt');
     $rate = $rates->getRateForCountry('NL'); // 21
     return $rate;

The jsonvat.com service has now been discontinued

Goodbye jsonvat.com šŸ‘‹
The jsonvat.com service has now been discontinued. Please find an alternative source for your EU VAT rates.

The work required to keep such a database up to date is too much for me to handle solo. It should be up to the European Union to provide this service rather than an individual like me.

Apologies for any inconveinence this may cause.

So what we do now.

Update readme for "path-for-storing-cached-file"

I tried to use
$rates = new Ibericode\Rates\Rates('/path-for-storing-cached-file');

but got the error message:

file_put_contents(ā€¦): failed to open stream: Is a directory

Now I changed it to: new Ibericode\Rates\Rates('/path-for-storing-cached-file/rates.txt');`

and it worked.

IPv6 and the Geolocators

So firstly, I just noticed that the standard geoip-service, ip2c.org, doesn't support IPv6. That, combined with the fact that the ip2country.info service is only for open source projects, might create some issues.

Secondly, the provider for ip2country.info uses urlencode() on the ip-addresses. While that doesn't cause issues for Ipv4 addresses (a period . is encoded to a period .), it does cause issues for IPv6 addresses, which uses colons instead of periods. Colons : are translated to %3A, while the ip2country.info API expects a :.

I'm going to be submitting a pull request which fixes this issue in a few minutes, by removing the urlencode. But it might be wise to consider a ip2country service which allows closed-source projects to use it with IPv6, so closed-source projects can use this library with IPv6.

I might end up submitting a pull request with a new service, if I can find a IPv6-ready, GDPR-compliant IP2Country service.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.