Giter VIP home page Giter VIP logo

Comments (10)

DragonBe avatar DragonBe commented on July 19, 2024

Hi @mikeSimonson,

Our workflow is to add VAT ID's into a queue that's been picked up by a worker that checks for a heartbeat before processing. If there's no pulse, it waits for 30 minutes and tries again. If there's a pulse it validate the VAT ID from the queue.

I hope this gives you a pointer how to deal with the service. Yes, I know it's not a reliable service, but with the heartbeat we can mitigate the issue before we start processing.

from vies.

mikeSimonson avatar mikeSimonson commented on July 19, 2024

Thanks

from vies.

marcwales avatar marcwales commented on July 19, 2024

Hi, is there a way of blocking the validation process using the vies europe server link. This server is down almost twice a week and is making the checkout process horrible long.
Here is what i'm looking for :

  • I wish to just validate every VAT number without checking it on the vies server (change the code to if the amount of numbers are correct like 9 digits, it validates the VAT number).
  • Then i'll check it manually when i have to ship the product with the "Delivery adress".

This VAT validation on magento is just bullshit because it just checks if the number exist. A simple google search and i can input any validate VAT number from another company to buy exclusif tax and let if ship to my adress. The best way to control is to check the VAT number manually with the adress for the B2B clients.

Hope you can help me.
Regards,
Marc

from vies.

krzaczek avatar krzaczek commented on July 19, 2024

@marcwales

Well sure .. If You look at the code . . the validateVat function calls validateVatSum here https://github.com/DragonBe/vies/blob/master/src/Vies/Vies.php#L242. Instead of calling ValidateVat that checks the number and if its valid (sum) it calls the api endpoint You could just call validateVatSum to check it offline (length, check-sum).

from vies.

marcwales avatar marcwales commented on July 19, 2024

Hi krzaczek,

Thank you for your fast reply ;) I'll try to change the code on this module, see if it works. But now that i'm looking at the code, i think it would be easier to change it directly on the native magento VAT module. Just blocking the VIES europe server check or add a fallback to the vatlayer server ( https://vatlayer.com/).

Regards,
Marc

from vies.

DragonBe avatar DragonBe commented on July 19, 2024

Hey @marcwales,

You can also use the "HeartBeat" functionality to verify if the service is online and active, as described in the main example in the README.md.

The way we do it is to have a worker listening to incoming VAT ID's from a queue system (Gearman, RabbitMQ, ZeroMQ, …), checks if the service is operational using the heartbeat functionality and if it is, processes the queue. If not it waits for 30 minutes to check again. A simple solution, but works very effectively as the validation of VAT ID's is something that can safely run in the background. A faulty VAT ID (e.g. not validated) will be marked in a report with validation ID (from VIES) including timestamp so we can hand it over to the finance department.

If you just want to verify the "correctness" of a VAT ID, you can use the checksum validation mentioned by @krzaczek above.

I'm looking to modify this worker so I can add it to the examples.

from vies.

DragonBe avatar DragonBe commented on July 19, 2024

Sorry, but during lunch I whipped up this small Proof-of-Concept to process VAT ID's asynchronously. It's rough code and should not be used as-is in production, but it should give you a good idea how to offload the VAT validation process in an asynchronous way.

Please see https://github.com/DragonBe/vies/tree/master/examples/async_processing for details.

from vies.

marcwales avatar marcwales commented on July 19, 2024

Hi DragonBe,

Thanks your for your fast response also ;) I'm not used to get this quick help on a forum. I'll test this week both solution in order to see which one is the best for the checkout process. I'll try to add the vatlayer api because it looks pretty good on their website.

Regards,
Sidney

from vies.

DragonBe avatar DragonBe commented on July 19, 2024

Hey @marcwales, I hope that now things are working out for you. If you have any feedback for us how we can improve the service, please let us know. The easier we can make this tool for you (and the rest of the world) to use, the better.

from vies.

DragonBe avatar DragonBe commented on July 19, 2024

Closing this issue.

from vies.

Related Issues (20)

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.