valeriansaliou / node-sales-tax

:moneybag: International sales tax calculator for Node (offline, but provides optional online VAT number fraud check). Tax rates are kept up-to-date.
https://www.npmjs.com/package/sales-tax
MIT License
306 stars 48 forks source link

Specify origin country per-method call #37

Open gf3 opened 3 years ago

gf3 commented 3 years ago

Hi there,

Thanks for building this wonderfully useful library. We're planning on using this in our e-commerce platform which allows users in several different countries to sell to their customers. This means we'll need to change the origin country on a per-estimate/invoice basis. Using a global origin introduces a race condition under our circumstances, i.e. when two customers from two different user's origins request an estimate/invoice at the same time.

Are there any plans to allow the origin to be set at the time the sales tax is requested? Thanks!

valeriansaliou commented 3 years ago

Hello! Thanks for the feedback. I'm leaving this open as I 100% understand this is a recurring need for Marketplace-type businesses, whereas ours (Crisp, for which this library was initially built), is a SaaS.

I'll probably provide a way to consume the library by creating independent instances of it.

gf3 commented 3 years ago

That sounds like a perfect solution. Thank you!

holm commented 3 years ago

This would be amazing.

Thanks for a very cool library, that I wish I had found earlier :)

valentindoulcier commented 2 years ago

Hi @valeriansaliou, Is there any news regarding this issue? Thank's!

valeriansaliou commented 2 years ago

I'm open to PRs on that. No bandwidth to do it myself.