on April 26, 2011
There is a one cent disparity between the sales tax that is displayed for order total in Magento and PayPal. Customers are invoiced for the correct amount of sales tax in Magento, but then if they choose PayPal as a payment method, then the sales tax displayed after the redirect to PayPal is $0.01 less.
Magento has had it’s fair share of troubles with rounding issues, not just for sales tax, but for shipping, handling fees, VAT and order totals as well. The solution to this specific issue with PayPal took awhile to figure out simply because searching for keywords, such as “Magento PayPal sales tax rounding error” yield a ton of results. There are many posts in the Magento forums deal with rounding issues that had to be sorted through as well. Unfortunately, none of these posts addresses the rounding error that leads to PayPal displaying a sales tax amount that is 1 cent less than what is shown in Magento. There are a lot of posts dealing with how Magento aggregates items / orders before applying tax and how tax is applied to shipping and handling fees, but none about the missing cent in PayPal.
The cause of the .01 difference is due to different rounding in Magento versus PayPal. Magento 1.3.x aggregates orders before applying sales tax; however, sometimes PayPal applies sales tax to individual products and then sums up all of those totals to get the tax amount. The problem here is that PayPal rounds the sales tax totals for the individual products before adding them all together, which can result in a lower tax being reported.
For instance, say there are two products worth 55.444 each and the tax rate is 10%. If the total cost of the two products are aggregated first (as they are in Magento), the total becomes 110.888 and so tax is 11.0888, which rounds to 11.09. If tax is applied to the products before they are aggregated you get 5.5444, which rounds to 5.54 for each product. Multiply this total by 2 (for each product) and you get a final tax of 11.08.
After sorting through all the chaff, the fix for this issue is surprisingly simple:
- Log into the Magento Admin Panel.
- Go to System > Configuration > Payment Methods.
- Scroll down to the PayPal Website Payments Standard section.
- In the “Transaction Type” drop down box, select “Aggregate Order” (instead of “Indivividual Item”).
- And you’re done. Sales Tax for orders should now match up between Magento and Paypal.