rhyswynne / easy-digital-downloads-taxamo-integration

Integrate Taxamo into Easy Digital Downloads. Make yourself Compatible with the VATMOSS EU Legislation
2 stars 6 forks source link

Checkout and add to cart are super slow with Taxamo activated #1

Closed rhyswynne closed 9 years ago

rhyswynne commented 9 years ago

We were having issues with the checkout being slow. We think we've got all the issues, but if anybody else spots this, please let me know.

samikeijonen commented 9 years ago

I confirm that checkout page seems slow. But I have no data at the moment how slow and why.

ptocknell commented 9 years ago

It happened to me as well (checkout being extremely slow). I am in the process of hiring a guy I know well on Freelancer to look into for me. We have a lot of European customers so this plugin has to work. I experimented a little with my two payment methods PayPal and Credit Cards (via authorize.net) and it seemed to be an issue with the PayPal standard although I did NOT test it nearly to confidently say that is it. It could be anything.

NateWr commented 9 years ago

22 significantly improves things, but there are still some issues. I'll dump what I find in here as I try to work through this in case anyone else is working on this problem.

It seems that the edd_get_cart_tax filter is called a lot on the checkout page (by EDD). Since the Taxamo integration hooks into that filter to make the API call, it's getting called over and over. I'm digging in now to see if this is intended behaviour.

rhyswynne commented 9 years ago

The latest commit (bf8e833f9db6bbd6ad6d726be05fdfbbc877c4e1) fixed a few issues with #22 should the country code be changed during checkout.

NateWr commented 9 years ago

Nice catch! I've just tested your fix now and couldn't see any problems. Nice and snappy checkout flow.

NateWr commented 9 years ago

I just tried to process a refund and got a PHP Warning:

Warning: Invalid argument supplied for foreach() in /home/themes/public_html/wp-content/plugins/taxamo-edd-integration/taxamo-edd-integration.php on line 776

Note that my copy is slightly out of date with master. It's pointing at what is now line 786.

foreach ( $taxamo_transaction_lines as $taxamo_transaction_line ) {

This refund was for a payment without any Taxamo transaction info, so probably need to check the transactions that taxamo is returning there. I'm into something else at the moment so can't look into this right away.

NateWr commented 9 years ago

ps - the refund still went through fine (though I doubt the Taxamo portion would have if there was anything to refund there).

rhyswynne commented 9 years ago

I'll take a look at this tonight :)

rhyswynne commented 9 years ago

I am happy this is fine, so I'm closing this.