jetsgit / spree_tax_cloud

Spree Interface for TaxCloud SOAP API
19 stars 32 forks source link

Tax is always 0.0 in Spree 2.2 #47

Closed michaelmichael closed 10 years ago

michaelmichael commented 10 years ago

I'm opening this issue for what appears to be a bug when using spree_tax_cloud with Spree 2.2. If 2.2 is not supported you can close it. It could be the same or similar to issue #41

Rails version: 4.0.4 Ruby version: 2.1.1p76

To replicate this bug, I create a new Spree 2.2.1 store with a postgresql database. Gemfile link

I run spree install --auto-accept to load the sample and seed data. I install spree_tax_cloud with bundle exec rails g spree_tax_cloud:install.

I add my configuration info to spree_tax_cloud through the admin interface, and create a new tax category called 'default' and make it the default tax rate.

I assign the 'default' tax category to any product and then attempt to purchase it. After selecting the shipping method and confirming the transaction I can see the request to Taxcloud's API in the log. It returns the correct tax rate, and calculates the correct tax amount. However, the displayed tax amount is $0.00.

For example, see this linked gist. Particularly the last two lines. This shows a transaction whose destination has a tax rate of 8.75%, and whose cart contains items totaling $19.99. The last line shows the correct amount of tax being calculated: $1.74913. However, the previous line shows $0.00 of tax being added to the order (if I'm reading it correctly).

Going through the same process above with a Spree 2.1 store results in the correct tax amount being displayed and added to the order.

jetsgit commented 10 years ago

You should not assign the default tax category

michaelmichael commented 10 years ago

Not assigning the default tax category does not fix the problem. Also, as mentioned above, tax is correctly calculated in 2.1 even with the default tax category set. I don't believe that's the issue.

jetsgit commented 10 years ago

@michaelmichael, if you look at the branches for spree_tax_cloud, the most current branch is at 2.1. @jdutil did request submit a p.r. updating the gemspec to Spree 2-2 which I approved but without thoroughly testing. Today I created a 2-2-beta branch, where I will address your issue. Please open another issue mentioning that branch. If you actually submit a PR that would be even more useful.

DO NOT SET DEFAULT TAX.

To quote from your issue:

"..., and create a new tax category called 'default' and make it the default tax rate."

Do not do that!

That is asking for trouble, even if you may have been able to get it to work. I will update README, but DEFAULT TAX should not be set. Spree Tax Cloud does not go through that mechanism. No tax rate should be set!

Also, I will be incorporating an integration of TaxCloud API for Return Authorization into the Spree Tax Cloud 2-2-beta branch. Feel free to check back in on this next week, any feedback would be appreciated.

Thanks! Jerry