awesomemotive / easy-digital-downloads

Sell digital downloads through WordPress
https://easydigitaldownloads.com
GNU General Public License v2.0
862 stars 475 forks source link

EU VAT is applied outside EU while showing correct amount on checkout page #9417

Closed xxtesaxx closed 1 year ago

xxtesaxx commented 2 years ago

Bug Report

Sometimes, customers outside the EU are charged with EU VAT which is not visible on the checkout page but only after proceeding to pay.

Expected behavior

When the user changes the country from an EU country to an non-EU Country, there should be no tax collected from the customer.

Actual behavior

Sometimes, even customers outside the EU are charged with VAT. In the backend where we can view the order, it says that no VAT was charged but in the Stripe/PayPal backend, we can see that VAT actually was charged.

Our company is located in the EU so we have to charge VAT for EU customers. When I change the country to a non-EU country, the "total" on the checkout page is updated and displayed correctly (e. g. in Estonia where you have 20% VAT, a 49€ product would cost 58,80 whereas in the United States, we must charge 0% VAT and the product costs 49€). By default the country is set to Estonia.

However, once I change the country, for example to the United States, the "data-total" attribute of the second .edd_cart_amount Element is not updated everywhere on the checkout page.

Bildschirmfoto 2022-09-06 um 22 04 39 Bildschirmfoto 2022-09-06 um 22 04 45

Maybe that is connected somehow with why sometimes (not always) customers are charged VAT outside the EU. We are not fully sure what causes PayPal or Stripe to have VAT attached to the payment when the checkout page clearly states that 0% VAT is charged.

Also we noticed in our backend as well as in stripe, that the tax rate is set correctly to 0 yet still some amount is added:

Bildschirmfoto 2022-09-06 um 23 21 01

WhatsApp Image 2022-09-01 at 13 25 08

Steps to reproduce the behavior

1) Visit https://www.divi-pixel.com/ 2) Click the "Buy Now" button in the menu 3) Choose a plan and proceed to checkout 4) Change the country from Estonia to United States and enter the rest of the data 5) Click the purchase button and sometimes you'll see 20% VAT beeing added when on the checkout page it says 0% VAT

Information (if a specific version is affected):

PHP Version: 7.4 EDD Version (or branch): 3.0.3 WordPress Version: 6.0.2 Any other relevant information: We use the "Easy Digital Downloads - EU VAT (1.5.8)" plugin for calculating VAT rates

cklosowski commented 2 years ago

@xxtesaxx This appears as though would need to be addressed by the team that builds the EU VAT plugin. It is built and maintained by the team at Barn2: https://barn2.com/wordpress-plugins/easy-digital-downloads-eu-vat/

Have you reached out to them yet to ask about these inconsistencies?

Netzberufler commented 2 years ago

I have the same issue and already contacted the Barn2 support two weeks ago, but so far they did not get back with a solution to me.

I noticed the issue with EU-customers. When customers change from the default EU-country to another one with different a tax rate, the wrong tax is calculated and the wrong total amount is charged.

@xxtesaxx I recommend to check your EU-purchases as well. If a customer changed the country from Estonia to Italy for example, it can be that the tax rate was shown as 25% on the cart but the wrong total amount and tax amount were charged:

This shows as well in the data-totalattribute: <span class="edd_cart_amount" data-subtotal="49" data-total="58.8">€59.78</span>

For my shop the issue only seems to appear with Stripe and the cart fields in the checkout page, PayPal has always managed to pick up the correct tax and total amount. Therefore I have temporarily disabled Stripe for now.

Anyway, the problem caused me serious headache because we had to manually recalculate the correct VAT and recreate invoices. You can't charge customers only 19% VAT when it is required to charge 25%...

I really hope this is solved soon by either Barn2 or EDD, or with combined forces.

Netzberufler commented 2 years ago

I have orders which show a tax rate of 21% but were calculated with 19% (49€ * 0,19 = 9,31€). edd-tax-rate It should be 10,29€ VAT and a total amount of 59,29€. Not really possible to charge the customer the missing 0,98€ afterwards...

I'm not sure if the data-total attribute is directly responsible for this, but it shows to me that the values are not updated properly through the whole application and the wrong values are handed over to the payment gateway.

cklosowski commented 2 years ago

Okay thanks for the details. We'll see if we can replicate this on our end so we can see if it's on our end or on the Barn2 end.

@Netzberufler Do you have any settings in EDD for tax rates you can show us a screenshot of so we can try and mimic your configuration and produce the same results?

Netzberufler commented 2 years ago

The EDD EU VAT plugin takes care of setting the right tax rate for each EU country in the background, which means the current VAT rates are baked into the plugin (because they change often and users would forget to update them).

Therefore there are not added any tax rates in the EDD settings:

edd-tax-settings edd-tax-rates

Netzberufler commented 2 years ago

And thanks so much for taking a look, I highly appreciate it.

Netzberufler commented 1 year ago

Okay it looks like this issue is solved for me.

After further investigation with the Barn2 team it turned out the issue only appeared with Stripe. The problem was that updates for my Stripe Payment Gateway extension somehow stopped and I was not running the latest version. I used version 2.8.1 instead of 2.8.12. Funny & stupid thing is that I actually checked the version number but missed the slight difference :/

I could also see that the extension was renamed from "Stripe Payment Gateway" to "Stripe Pro Payment Gateway". Not sure this has anything to do with not getting updates. I got updates for all other extensions except Stripe.