Welcome to WebmasterWorld Guest from 184.108.40.206
$res = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$resp = explode("\n\r\n", $res);
$header = explode("\n", $resp);
echo "HTTP Code: " . $httpCode . "<br />";
Here's the output:
HTTP Code: 200
 => HTTP/1.0 699 20111: Missing card or check number
 => Connection: close
 => Content-Type: text/plain
 => Content-Length: 0
As you can see from the actual header, the code is 699, but cURL is claiming it's 200. Any ideas what this may be?
I appreciate the help. I know that my input is incorrect, I'm actually trying to code the error handling portion so I want to receive errors from the gateway. The way the gateway's API handles errors, is it returns various HTTP codes along with the header to indicate the reason for the error. For example, take a look at this header viewer site that shows the gateways header response:
header viewer [web-sniffer.net]
From the gateway docs: "Exception are reported as HTTP errors". Here is the API documentation on exception reporting: Exception reporting [netbilling.com]
ahh i see... it sounds like it must have something to do with the way curl is grabbing the http code. if they are using http codes as a means of exception reporting, then maybe using fsockopen() and manually sending the request will show you whether curl is causing the problem or not... if it is, maybe some curl config stuff can fix...
Well here is the output of using fsockopen:
HTTP/1.0 604 Missing Parameter (pay_type) Connection: close Content-Type: text/plain Content-Length: 0
The http code coming back is definately not 200. I'm stumped.