txcrb / tax_cloud

Ruby gem to calculate sales tax using TaxCloud.net
MIT License
71 stars 48 forks source link

Return sales tax percentage in response #29

Open drewtempelmeyer opened 9 years ago

drewtempelmeyer commented 9 years ago

Based on the question in #28, it would be great to add support to return the calculated sales tax percentage. Since not all items will be taxable, relying on the tax amount and total of the purchase is not accurate.

thomasjoyce commented 9 years ago

hi Drew,

thanks for responding quickly. good to know. :-)

by the way, does this gem decide whether the amount is taxable base on the origin and destination of the address? [as far as i know the location of the merchant, the location of the customer and the type of product will determine if it need to be tax or not ]

for example, our site have many merchants who does business with us thru their own customer and if the owner of the location state address is not the same as the customer state address, i believe we don't tax them.

will tax_cloud gem decide that for me given the state address origin and destination is not the same? in this case no tax, only tax customer if the location state address is the same as the location state of the merchant.

drewtempelmeyer commented 9 years ago

@thomasjoyce the gem doesn't decide on the taxable amount. The gem simply makes API calls to the TaxCloud API. From there, TaxCloud determines what is taxable. In most cases, the taxable amount is based on origin and destination.

I believe it comes down to who's selling the item(s). This will be either you or the merchant. You may want to consult a professional for this information.

paulhenrich commented 7 years ago

I did a little investigation into doing this, but it looks like the actual percentage doesn't come back in the SOAP response for lookup. It would be nice if it did.

Was your thought to look at CartItems that come back with a TaxAmount and use that to calculate tax rate? Maybe like:

def max_rate(cart)
  cart.items.reduce(0) { |max_seen, ci|
    [ci.tax_amount / ci.total, max_seen].max
  }
end
ghepting commented 4 years ago

Yeah I'm trying to figure out how to best get the tax rate when the API lacks this information as well. I'm doing a custom integration with Square APIs for the order/payment and they require a percentage in their order.taxes parameters. Do we have a decent technical contact at TaxCloud that I should ask about secret API endpoints for this metadata? They should this information in the TaxCloud dashboard, so they definitely have the information available (obviously). :)

dblock commented 4 years ago

@ghepting I haven't worked on this in many years, but TaxCloud was fairly responsive when I did. Maybe @drewtempelmeyer knows more.

Either way if you do end up using this library it could use some help/an active maintainer, etc.!

drewtempelmeyer commented 4 years ago

@ghepting @dblock I've not worked with TaxCloud in years, either. I'd suggest reaching out to their support/dev team.

ghepting commented 4 years ago

Yep, I emailed them yesterday and expect to hear back tomorrow during business hours.