PHP: cybercash_decr - Manual

downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

cybercash_encr cybercash_base64_encode

Last updated: Fri, 26 Jan 2007

view this page in

# cybercash_decr

(PHP 4 <= 4.2.3, PECL)

cybercash_decr -- Cybercash decrypt

## Description

array cybercash_decr ( string wmk, string sk, string inbuff )

The function returns an associative array with the elements "errcode" and, if "errcode" is `FALSE`, "outbuff" (string), "outLth" (long) and "macbuff" (string).

add a note User Contributed Notes
cybercash_decr
scott at mha dot ca
02-Oct-2001 08:09
`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"]);
}`
add a note
cybercash_encr cybercash_base64_encode

Last updated: Fri, 26 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 09:32:46 2007 PST