I'm done some looking around but haven't really found anything to help me do what I would like to do....so I'm coming here for help or advice!
I have an order form on one of my sites. Now, the way it's setup right now is that you fill out the form, and then you are redirected to the payment processor to complete payment. But lately, there have been issues with the payment processor going offline....which is giving my customers an error page instead of the payment screens.
What I am wanting to do is create some type of "checking" code within the order form where it "attempts to connect" to the payment processor, and if it does not receive an HTTP error code, then it would display the Order Form to continue with the process as normal.
But....if the return was an error code (404, 500, etc.) then it would display an "Unavailable" page instead of the order form.
Now, the section here I'm not sure how to do would be the "checking" of the site and determining what HTTP code is received. I'm assuming I would be able to accomplish this through some type of socket....but not sure. Unable to find any good documentation anywhere.
If anyone can point me in the right direction, I would greatly appreciate it!! Thanks!!