Hope someone can help...
I'm trying to integrate my site with a payment processor and am having some trouble processing their HTTP response.
I'm checking for the word 'Processed' in the response string. Every time it's there, I need my code to echo 'WORKED'.
The problem is that my code is behaving very unpredictably. Sometimes when the bank returns a 'Processed' response, everything goes fine and I get the 'WORKED' result I'm looking for; other times, even for a 'Processed' response, my code inexplicably returns 'FAILED'...
Here is the code I'm using:
//the processed response I'm looking for from the bank
$p = "Processed";
//checking the HTTP response string for the 'Processed' response
$proc = strpos($fgets,$p);
if($proc === false){
//the result I'm sometimes getting even if the bank returned a 'Processed' response
echo "FAILED";
}
else if(!$mysqldb->increaseDeposit()){
//not usually getting this error - don't think there's a problem with the database function
echo "DATABASE ERROR";
}
else{
//the result I need every time I get a 'Processed' response from the bank
echo "WORKED";
}
All my other functions are working fine on the site, just this one which I can't fathom...
Anyone any ideas why it's behaving so unpredictably and/or suggestions as to how I could process this response reliably?