Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False response data #66

Closed
juretopolak opened this issue May 24, 2019 · 6 comments
Closed

False response data #66

juretopolak opened this issue May 24, 2019 · 6 comments

Comments

@juretopolak
Copy link

I have noticed incorrect validations. Look at the example below. Same VAT number with different results:

  • Yes, valid VAT number (correct on VIES website)
  • ["valid":protected]=>bool(false) (incorrect response $vatResult->isValid())

Am I missing something?

http://ec.europa.eu/taxation_customs/vies/vatResponse.html

Yes, valid VAT number
Member State | SI |  
VAT Number | SI 21825831
Date when request received | 2019/05/24 11:49:44

object(DragonBe\Vies\CheckVatResponse)#4999 (7) {
  ["countryCode":protected]=>
  string(2) "SI"
  ["vatNumber":protected]=>
  string(8) "21825831"
  ["requestDate":protected]=>
  object(DateTime)#472 (3) {
    ["date"]=>
    string(26) "2019-05-24 11:53:56.789394"
    ["timezone_type"]=>
    int(3)
    ["timezone"]=>
    string(16) "Europe/Ljubljana"
  }
  ["valid":protected]=>
  bool(false)
  ["name":protected]=>
  string(3) "---"
  ["address":protected]=>
  string(3) "---"
  ["identifier":protected]=>
  string(0) ""
}
@DragonBe
Copy link
Owner

Hello @juretopolak,

Thank you for reporting this issue. I will investigate this next week since I'm traveling for work at the moment.

@krzaczek
Copy link
Collaborator

@juretopolak which version of the library and PHP are You using ?. I did a quick test and the results are as follow

DragonBe\Vies\CheckVatResponse Object
(
    [countryCode:protected] => SI
    [vatNumber:protected] => 21825831
    [requestDate:protected] => DateTime Object
        (
            [date] => 2019-05-24 02:00:00.000000
            [timezone_type] => 3
            [timezone] => UTC
        )

    [valid:protected] => 1
    [name:protected] => E+ PROJEKT D.O.O.
    [address:protected] => ŠRATOVCI 57, 9252 RADENCI
    [identifier:protected] => 
    [nameMatch:protected] => 
    [companyTypeMatch:protected] => 
    [streetMatch:protected] => 
    [postcodeMatch:protected] => 
    [cityMatch:protected] => 
)

@juretopolak
Copy link
Author

@krzaczek thank you for pointing me in the right direction... it was indeed a problem with library version. My version was 1.0 xD

I have installed it with "composer install dragonbe/vies" and didn't define a version... thought that if no version is specified the last one is used. Didn't even look in the composer.json.

After defining the last version (2.1.6) and updating everything is working as expected.

Thank you for such a fast response!

@DragonBe
Copy link
Owner

Hey @juretopolak,

Glad everything sorted out for you. A huge thanks to @krzaczek for analysing the issues and pointing towards the solution so quickly. Great job 👍

One thing though: I checked myself using composer install dragonbe/vies and I got the following error message back from composer

composer install dragonbe/vies
Invalid argument dragonbe/vies. Use "composer require dragonbe/vies" instead to add packages to your composer.json.

And when using composer require dragonbe/vies it installs the latest 2.1.6 version by default.

composer require dragonbe/vies
Using version ^2.1 for dragonbe/vies
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing dragonbe/vies (2.1.6): Downloading (100%)
Writing lock file
Generating autoload files

@juretopolak since I want to make sure people always get the latest version your issue intrigues me. Could you describe your installation process to me?

@krzaczek
Copy link
Collaborator

I would say it has to do with PHP version used to run composer.

PHP 5.3 would install 1.0.1
PHP 5.4 - 5.6 would install 1.0.6
PHP >=7 would install 2.x

@juretopolak
Copy link
Author

juretopolak commented May 29, 2019

You are both right.

If I go through the history... it was like this.

composer install dragonbe/vies

This returned error message, just like you explained.

composer require dragonbe/vies

This installed version 1.0.0. I guess because the composer was executed with PHP 5.6 which is default CLI version on the system.

After I found out that version 1.0.0. was installed, I have changed the version to 2.1.6 in the composer.json file.

composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
    - dragonbe/vies 2.1.6 requires php >=7.1 -> your PHP version (5.6.40) does not satisfy that requirement.
    - dragonbe/vies 2.1.6 requires php >=7.1 -> your PHP version (5.6.40) does not satisfy that requirement.
    - Installation request for dragonbe/vies ^2.1.6 -> satisfiable by dragonbe/vies[2.1.6].

This reminded me about the default version.

/usr/local/php72/bin/php72 /usr/local/bin/composer update

The library was finally updated when PHP 7.2 was used to run the composer.

Hope this helps somehow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants