Jump to content

Force a 500 server error response to a requesting application..??


angelleye

Recommended Posts

This should be real simple I just don't know how to do it.  I'm using PayPal IPN to process order data.  IPN is setup to automatically re-try the IPN if doesn't receive a 200 OK response back from the IPN script.  In my solution, though, I'm actually storing any MySQL errors and notifying the site owner so the script actually does successfully complete and send a 200 OK back to PayPal, therefore, the IPN is not re-tried.

 

I'd like to send a 500 (or anything other than 200) back to PayPal when this happens, but of course, the script still needs to run successfully.  Is there a way I can use header() or anything to force a specific response code back?  This way if it's simply a matter of MySQL timing out (which tends to happen on shared servers sometimes) PayPal's system will re-try and I won't have to enter it myself.

 

Any information on this would be greatly appreciated.  Thanks!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.