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
299 stars 45 forks source link

Returning false on all US checks #10

Closed msolda2 closed 5 years ago

msolda2 commented 5 years ago

SalesTax.hasSalesTax("US") as well as any state that has sales tax such as SalesTax.hasSalesTax("US", "CA") returns as false

valeriansaliou commented 5 years ago

Which tax origin have you set while configuring the library? Is there any?

--

Valerian Saliou CTO at Crisp

On 12 Mar 2019, at 6:10 PM, msolda2 notifications@github.com wrote:

SalesTax.hasSalesTax("US") as well as any state that has sales tax such as SalesTax.hasSalesTax("US", "CA") returns as false

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

msolda2 commented 5 years ago

SalesTax.setTaxOriginCountry("US")

but your docs says this anyway:

Notice: this method is origin-neutral. It means it return values regardless of your configured tax origin country.

valeriansaliou commented 5 years ago

You're looking for the SalesTax.hasStateSalesTax("US", "CA") method rather; can you check it works? The US as a country does not have any country-wide sales tax, which is why the SalesTax.hasSalesTax("US") method returns zero. Rather, you need to check per-state with the appropriate method.

msolda2 commented 5 years ago

Got it, thanks!