note 15785 deleted from function.cybercash-decr by philip

From: Date: Fri, 18 Apr 2008 04:57:33 +0000
Subject: note 15785 deleted from function.cybercash-decr by philip
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-138435@lists.php.net to get a copy of this message
Note Submitter: scott at mha dot ca ---- assuming that you have a function called "read_value_pairs" which will convert a urlencoded string into an array of values .. this should more-or-less work: $vars = read_value_pairs($response_from_http_form_post); $vars["message"] = cybercash_base64_decode($vars["message"]); $vars["mac"] = cybercash_base64_decode($vars["mac"]); $decr = cybercash_decr($merchant_key, $vars["session-key"], $vars["message"]); if($decr["errcode"]) { $response["MStatus"]="failure-hard"; $response["MErrMsg"]="error talking to server."; } else if($decr["macbuff"] != $vars["mac"]) { $response["MStatus"]="failure-hard"; $response["MErrMsg"]="signature does not match."; } else { $response = read_value_pairs($decr["outbuff"]); }

« previous php.notes (#138435) next »