osCommerce & PayPal IPN Invoice Error
I’ve just had an email from a customer about an order through one of our osCommerce run shops saying they had placed an order but when they had gone through to PayPal, they received a message saying
“ERROR DETECTED: This invoice has already been paid. For more information, please contact the merchant.”
I checked PayPal and there was no transaction but when checking in osCommerce the customer had placed an order which appeared to be paid for, After a bit of checking I found out what was causing the problem and the fix as well!
It appears that when using the PayPal IPN, it requires a unique Invoice Number for each transaction which isn’t a problem most of the time. We’ve had a problem because we’re using the same PayPal account (email address) for several shops. Unfortunately since we’re using seperate installations of osCommerce and therefore seperate databases for each, there’s sometimes a overlap of invoice numbers.
Luckily we aren’t the first and you can find the solution on this osCommerce Forums Thread

