As many of you know I’ve been working on my own products at Never5 for some time now. I currently have 4 webshops where I sell various WordPress plugins, 3 of them run on WooCommerce. Today I found out about an issue that might be a shop-owners worst nightmare, customers that try to place an order but can’t pay.
Someone sent me this email today:
I wanted to purchase a developer license. Unfortunately the PayPal-Gateway doesn’t seem to work.
We received a confirmation email, that an account was created. I can see the purchase in my account (/my-account/) and that the payment is still pending. If I try to pay from there, I still get the following message from PayPal:“This invoice has already been paid. For more information, please contact the merchant
Your purchase couldn’t be completed
There’s a problem with the merchant’s PayPal account. Please try again later”.
Apparently WooCommerce was creating the order, leaving it at pending and PayPal would not allow the user to pay for the order because according to them it was already paid for. After doing some research I found out that PayPal keeps track of the Invoice ID you pass to them and actually checks upon payment if an order with that Invoice ID has already been paid.
WooCommerce allows you to prefix the invoice ID, having a default prefix of WC-
. The problem I was running into is that I never changed this default prefix, for all 3 of my WooCommerce shops. So when someone purchased a Related Posts for WordPress Premium license, WooCommerce would generate a PayPal invoice ID of WC
– + ORDER_ID
. As an example this would result in: WC-100
.
Normally this would be unique, because you can’t have 2 orders with the same ID in WooCommerce. But I have 3 WooCommerce shops, so there’s a chance that an order with the same ID was done at PayPal by one of my other shops. When this was the case PayPal would prevent the user from paying the order because a payment for the same invoice ID was already recorded.
Luckily the solution is very simple. You go to your PayPal settings in WooCommerce and make sure every store has an unique invoice prefix, in my case like this:
This was quite an annoying and hard to track down issue because it doesn’t happen all the time. WooCommerce uses WordPress’s default post ID’s so this value increments at a different rate per shop and even if multiple shops get an order with an overlapping ID they have to be paid for with the same payment provider (PayPal in this case). On top of that I was very lucky that the person running into this issue today contacted me (!!). Most people would close the tab and move on, making you lose a sale because of a misconfiguration.
Looking at my shop history there were multiple pending and failed orders that could be caused by this misconfiguration. I’m not saying they are, there are also a lot of people who just close their browser at the payment screen for various reasons.
I hope this helps you in solving (or even better, preventing) this specific issue. Losing sales because of silly things like this makes you sad panda shop-owner.
HI Barry, I’m looking at implementing 2 woocommerce sites to one paypal account. I have both sites using different prefixes, however my question relates to how you set up the return address in paypal? Surely it can only be set to one site. Any advice would be great! thanks.
Thank so a lot for posting this Barry! I am new to WooCommerce and trying to learn everything I can. I’m considering making my 3 sites all WooCommerce accessible and so I’m happy to see that it is a possibility.
I know that this is not entirely related to your post but I was wondering how do you handle the IPN from PayPal? Because you need to use the same account on different stores.
Thanks in advance!
Hi Barry,
This is a really useful post. I’m glad I came across it before going ahead with my next WooCommerce store.
I’m wondering though, as Paul and Jorge have mentioned above, how do you handle the Return URL issue that exists due to the fact that Paypal only allows one Return URL address?
I have more than one domain that sells and only 1 Return URL option in Paypal. Is there a workaround that you know of?
I recognise the possibility of using a hidden field in a Paypal button () but I have 2 issues here:
1. How to add this to a WooCommerce environment.
2. Having the Return URL in the outbound link to Paypal might open up security holes.
Any thoughts would be appreciated.
I’m glad to read your post soon. I’m going to have the second WooCommerce store and use one PayPal account for two of them. Luckily you’ve pointed out this problem. Thanks for sharing!
Thank you for sharing this. Having an issue right now. Hopefully this is now fixed.
Thanks for this nice and helpful post!
Thank you for sharing this information.