a touch of background.
I work for a restaurant, I code somewhat but nothing special and never used paypal before. My boss got a website done which seemed to get passed around whislt a lot and the whole website (whilst working) is a horrible mess.
The Problem: Our orders keep repeating (whilst money doesn't, thankfully) as an IP from 173.0.81.1 .
The code is in this format ww.website.com/paypal -> controller@paypal
function paypal{ getdetails and to database then the exact code from https://developer.paypal.com/docs/classic/ipn/gs_IPN/ }
Notably $fp = fsockopen('tls://www.sandbox.paypal.com', 443, $errno, $errstr, 30);
Should it still be using sandbox?
After an order processes and we get paid, paypal keeps connecting to website.com/paypal, for days after, which makes the order keep adding to the database. I did notice they had forgotten to do fclose($fp); but after adding there is no change.
Is the code missing something, has paypal updated and can you give me any help?
Thank you in advance guys, feel free to ask for more details
As @frz3993 eluded to, PayPal is sending IPN notifications to the listener URL configured in the account (or in the payment request), but that script must be failing even though it's updating the database successfully. As such, PayPal's system keeps re-sending it because it thinks it failed.
Check your IPN History in the PayPal account to see if it shows 500 errors. Sounds like it will. Then you'll want to check your PHP error logs on the server to see what's going wrong when that particular script runs.