PayPal integration not working sometimes

So I'm using the PayPal integration code sample and it works most of the time, but every so often when someone purchases, it doesn't seem to work at all. The payment goes through, but the product key isn't created and no email is sent.

I added some code to email me when there is an error, instead of logging these to file, but that doesn't seem to get called either.

I'm having trouble identifying a common thread as to the problem.

Any quick thoughts?

I apologize for my vague description of the problem. I'm baffled.

Is the pp-checker.php even being called? Turn on logging (make sure the log location is a non-public location). You can also check your Apache access logs to see if the script is being called from PayPal.

I'm not seeing our servers dropping any requests.

Check the error logs on your servers to see if apache has any "error 5xx" around the time these orders are placed. (500-series errors are internal server errors). Also check you php logs to see if there is any fatal errors in the script.