driesvints / vat-calculator

Handle all the hard stuff related to EU MOSS tax/vat regulations, the way it should be.
MIT License
1.2k stars 88 forks source link

Every VAT-ID is invalid? #135

Closed ahoiroman closed 3 years ago

ahoiroman commented 3 years ago

Hello,

I am using Laravel Spark with Stripe. Now I mentioned that every VAT-ID seems to be invalid? That's too bad, I even used my own address.

At least, I am getting the error:

The provided VAT number is invalid

driesvints commented 3 years ago

Please provide a VAT ID for me to check.

ahoiroman commented 3 years ago

Hi,

sure: DE330284431

ahoiroman commented 3 years ago

But it seems like it's not working for any Tax-ID. Is the fact that I am using Laravel-Sail of any help?

I just checked a basic curl from inside the container

sail@5970dad982dc:/var/www/html$ curl -L https://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="urn:ec.europa.eu:taxud:vies:services:checkVat" xmlns:tns1="urn:ec.europa.eu:taxud:vies:services:checkVat:types" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:impl="urn:ec.europa.eu:taxud:vies:services:checkVat" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/">
  <xsd:documentation>
... 

This is - of course - not really a check, whether the SOAP requests are working, but at least I know that the container can resolve the service.

EDIT: I just checked and even outside of sail the validation does not work.

dragonfly4 commented 3 years ago

VIES is very unreliable and it's down for the moment. https://ec.europa.eu/taxation_customs/vies/vatRequest.html

Not a bug but it would be better to return a different error message when the SOAP api is down.

VIES-BE02

VIES-BE

driesvints commented 3 years ago

@ahoiroman if you set this to true in your config file, does that solve the issue for you? I mean: do you then get the VATCheckUnavailableException ?

https://github.com/driesvints/vat-calculator/blob/3.x/config/vat_calculator.php#L34

ahoiroman commented 3 years ago

That seems to solve the issue.

But: As I am using Laravel Spark (which uses this package under the hood), I'd have to create a new issue for that project.

driesvints commented 3 years ago

@ahoiroman the latest version of Spark should respect the settings of the config file. Doesn't it work for you if you use the latest spark-stripe? You're not using the old spark by any chance?

ahoiroman commented 3 years ago

Ah, okay. From my point of view that was not clear on reading the spark docs. That works for me now.