I can't determine the best way to debug my Facebook Payments Callback PHP file. The script isn't requested on the client side, so I'm not sure how to pass any "authentic" values to the script to run it locally. The topic doesn't seem to be covered in any of the Facebook documentation, nor was I able to find it on Google (with the exception of this previously asked question, which was seeking to debug the script with no internet connection at all), so hopefully the answer is just that obvious and simple. So far my only two 'solutions' have been to make the script output a text file containing any debug output, or blindly hack away at the code until the vague client-side API errors go away.
Asked
Active
Viewed 386 times
1 Answers
1
There is another option. Mail the output to yourself. I find it more convenient than reading a text file.
ob_start();
//the contents of your file
$output = ob_get_clean();
mail(
'youremail@email.com',
'fb_payments',
$output,
'From: noreply@misite.com' . "\r\n".'X-Mailer: PHP/' . phpversion()
);
echo $output;
Additionally, you can also capture the $_POST information you get from Facebook and send it it to the file through a form/javascript, locally. Then you don't have to have Facebook ping it, and you can see the errors in your browser.

Paul Cristea
- 453
- 4
- 10