The question said it. The IPN works great when I use the Sandbox to test my *automatic* online digital (download-able) store system or more like marketplace. No error. No problem. $fp = fsockopen ('ssl://www.sandbox.paypal.com', 443, $errno, $errstr, 30); PHP: https://www.sandbox.paypal.com/cgi-bin/webscr Code (markup): So then it should works LIVE, right? NOPE! When buyers reach the final page, they get an error. Yes I did switch sandbox to LIVE: $fp = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30); PHP: https://www.paypal.com/cgi-bin/webscr Code (markup): So what is the problem? Why can't PayPal LIVE works IF the PayPal Sandbox works? I spent hours, days searching for the answer but can't seem to find one.
I'd say the post parameters aren't passed correctly to your script. It would help if you'd tell us what the error is...
I think it might be an fsockopen issue. I saw something similar on here not so long ago, and it was because they were using fsockopen instead of cURL
sounds like the story of my life - maybe you need a fresh pair of eyes to look over your script, it's always something you did wrong that you just skim over because you expect it to be correct, which is the problem. if not, try using stream_socket_client instead of fsockopen. btw, are you running the sandbox and the live versions of your script(s) on the same host?
Well- not sure exactly what the 'error' is.. when a buyer come back to the website page after paying thru PayPal, they get the invalid transaction error. So they hit the 'INVALID' part of the IPN script. else if (strcmp ($res, "INVALID") == 0) { // log for manual investigation $subject = "Transaction failed! *PayPal*"; $msg = "Transaction failed *PayPal* Wrong paypal payee information or someone try to make fake payment."; mail($adminmail, $subject, $msg, $adminmail); include("invalid.php"); PHP: The IPN code is from PayPal: https://cms.paypal.com/cms_content/US/en_US/files/developer/IPN_PHP_41.txt
Yeah I heard from PayPalDeveloper.com, cURL is recommended but I can use fsockopen with no problem when using sandbox. I might try using cURL.
I use WinMerge to compare two files (one for sandbox & one for live) so that I don't miss something or overwrite codes. Yes I am running both sandbox and live files on my host/domain.
Well, I'm not sure if you're doing this or not but make sure you're logged into the developers area when testing.
#1- I finally able to code the cURL php file. At first, when I made test purchases through Sandbox, orders were not going through, no emails, etc. I went to Google to search and found a website that talked about IPN problem and it mentioned about PayPal required values. See #2. #2- PayPal MUST have required values (for IPN) to pass *back and forth* to my final/IPN page. I noticed there were 1 or 2 required values missing so I added those missing fields/values. Now it seem to be working in TESTING mode (Sandbox). See here-> http://www.web-development-blog.com/archives/easy-payments-using-paypal-ipn/ I haven't tried it LIVE yet. Will do it tomorrow.