Support

Pre-sales

#28952 VAT on renew

Posted in ‘Pre-sales and Account Questions’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

pinguinone
Hello,
I try to renew my subscrition but the system applies VAT, I try to see on the VIES and I'm currently registered without any problem. My vat number is 08964910965
How can I solve it and make the renew?

nicholas
Akeeba Staff
Manager
Please try logging out and back in to our site, in case there is something stuck in the current user session.

If he problem persists please make sure that you have set the Subscribing as a business option to Yes in the subscription page, your country selection is Italy and that you are entering your VAT number without the IT prefix. After entering the VAT number click elsewhere on the page, for example the blank space next to the VAT box. Within 3-7 seconds you should see the price breakdown update with no VAT.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

pinguinone
I follow exactly what you say but no success.
I have near the VAT number this message:

VAT number is not VIES registered or the European Union VIES system is currently out of service.

(I have it also before).
I make a little debug on the page, and sometimes it appear two 404, I suppose that you called a old version of the VIES API(You don't expose it on the cose...so or it is codebehind or is by Javascript and I don't explose it)....please take a look and let me know


Gianluca

nicholas
Akeeba Staff
Manager
Thank you for the debugging, but it's off the mark by quite a bit :) I was not in front of a computer so I couldn't check a few things. Now that I'm back, please let me explain what is going on.

The European Union VIES API is SOAP and only accessed from the backend PHP code. It is not available as a Javascript-facing API and of course we cannot call something which does not exist.

Moreover, this API only has a single version. This is the only version ever provided, the only version still provided and the only version currently used.

The URL being accessed by the Javascript is on our site. It is sent the data in your subscription form, which is then verified for validity, stored in the user session and the result is sent back to the server. Part of the validation is contacting the EU VIES server. It is not returning a 404. What you see is a browser artefact when it tries to access in the dev tools via GET a URL only designed to be accessed via POST.

However, this is irrelevant. The problem is that the URL does return a result which says there's a validation error with the VAT number. Every time there is a validation error we keep a log file and I could indeed find yours. The problem is that the VAT number is not being recorded in the user state. Trying to follow your steps on my account I can enter your VAT number and it does validate.

Looking at the logs I saw something interesting. Your session and a previous user's session from 5 hours ago have the same ID. That's a 1 in 4294967296 chance. She had not entered a VAT number and that was being picked up in your session. This points to a Joomla or PHP bug (I have to test which of the two does it) which I suspected for the last year. I couldn't reproduce it which is why two months ago I started logging validation failures. Your case was the first in these two months. So thank you very much for breaking the case!

While I investigate what's going on let's try to work around that elusive bug. We need to change your session ID. Here's the catch. Even if you log out the session ID won't change since it's stored in a cookie on your browser. You can either clear the cookies on your browser OR use a different browser. In either case, next time you visit our site a new random session ID will be assigned to you and that will fix the issue you are experiencing.

If all else fails just subscribe anyway and reply back to this ticket so I can do a partial refund and issue the necessary paperwork to make sure that you are not charged VAT after all.

In any case, please do contact me after subscribing. I want to give you 6 free months of subscription time for helping me debug this issue that's driving me insane the last year :)

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

pinguinone
Hi Nicholas,
thanks for your nice reply; very interesting. Finally I think that when people join effort and brain something must change. :-)
I try with Firefox and so far so good at the first time. I already make a renews, thanks for the additional 6 months, you are the best.
Can you give me also by mail or here as you prefer some techincal details for query the VIES service? I have to implement in one of my project and I don't find any documentation on the site...it could be very useful.

Thanks for the help and courtesy.
See you soon


Gianluca

nicholas
Akeeba Staff
Manager
I have added the free six months to your subscription.

Regarding the VIES code, please consult https://github.com/akeeba/akeebasubs/blob/development/component/backend/Helper/EUVATInfo.php#L137 and ignore the bit about caching the results (this if for performance reasons in Akeeba Subscriptions).

The actual code will first try to get a results from the EU VIES SOAP service. It will try up to three times if the service doesn't respond. If after three tries the service has still not responded it will try to submit the web form and examine its results. If that still fails then we are sure that either the EU VIES service or the VIES database of the client's country is down, in which case we have to assume that the VAT number is invalid.

The same helper class contains a few more goodies. The static table at the top contains the main VAT rates for all EU countries, including the sovereign territories which are outside the EU but belong to the VAT taxation scheme of the EU country they are dependent on. It does not, however, contain the VAT-exempt territories or regions (e.g. Canary Islands or some regions of Germany and Italy with special VAT rates). The first few methods of that class give programmatic access to that information which I regularly maintain.

As a side note, you may also want to do foreign currency conversions to / from Euro. I have a class for that which uses the ECB's foreign exchange rates (these are the nominal values, not the real sell/buy rate and do not include the bank's commission but are a good ballpark, usually within 3% of the real converted price). The exchange rates are cached in the database as you can see since they only get updated at most once a day on ECB's site.

Good luck!

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

System Task
system
This ticket has been automatically closed. All tickets which have been inactive for a long time are automatically closed. If you believe that this ticket was closed in error, please contact us.

Support Information

Working hours: Typically we work Monday to Friday, 9am to 7pm Cyprus timezone (EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets, but we cannot respond to them, outside of our working hours.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!

Summer vacations: Our support will be closed for replies and new tickets from August 6th to August 21st, 2022 due to summer vacations.