Site that handles PayPal payments through the IPN API, stopped working today. I use the sample php script provide by paypal to process IPN. After debugging I found that it mas missing the VERIFIED response you receive after submitting the request to confirm a payment notification. And neither was arriving "INVALID".
Finally, after adding code to trace the response, I thought that the actual response had a trailing empty space. This would explain that
if (strcmp ($res, "VERIFIED") == 0)
would'nt hit. Before that I added
$res=trim($res);
and things returned to normal -apparenly-. But I wonder if anyone else has experienced this today. (I am not sure of the exact character[s] that were being added but I just know that trimming the response fixed the problem.
$res
made me lose 24 hours of debugging time. How incompetent can PayPal be, to provide thisstrcmp()
sample code withouttrim()
and then not making sure their server reply is clean. – adrianTNT