My website has been working for years - I have not changed the IPN or PDT scripts, the database has not changed on my end at all....this just started the past 3-4 days...I am using SSL on my site, and communicating with PayPal via SSL for the PostBack. The GET string the customer is being sent back to my site with is correct, and looks like this: https://mysite.com/paypal-payment.php?amt=1.00&cc=USD&cm=216.55.17.15&item_name=MyService&item_number=12541&st=Completed&tx=6YP602222E974215W The payment gets processed by PayPal, and the customer is returned to the above URL ("paypal-payment.php"), but the IPN and PDT script does not complete. I troubleshot the PDT script and it seems the part of the script that posts back to PayPal is no longer returning data. The below code is where the problem is happening: $fp = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30);
if (!$fp) {
exitCode();
} else {
fputs ($fp, $header . $req);
// read the body data
$res = '';
$headerdone = false;
while (!feof($fp)) {
$line = fgets ($fp, 1024);
if (strcmp($line, "\r\n") == 0) {
// read the header
$headerdone = true;
}
else if ($headerdone) {
// header has been read. now read the contents
$res .= $line;
}
}
// parse the data
$lines = explode("\n", $res);
$response = array();
if (strcmp ($lines[0], "SUCCESS") == 0) { If I echo out the $line variable, this is what it says: HTTP/1.0 400 Bad Request Server: AkamaiGHost Mime-Version: 1.0 Content-Type: text/html Content-Length: 208 Expires: Wed, 12 Sep 2018 00:52:49 GMT Date: Wed, 12 Sep 2018 00:52:49 GMT Connection: close Invalid URL The requested URL "[no URL]", is invalid. Reference #9.b4d06bd1.1536713569.4439c06 So for whatever reason, I'm getting "bad requests" all of a sudden.... PayPal says they don't see any problems on their side - my hosting company says it's not them. Please help ASAP because this has a serious impact to my business. Each payment that comes in I have to manually update my database and send emails, etc since the script is no longer working. Willing to pay someone to help resolve. Thanks!
... View more