# private key file to use
$MY_KEY_FILE = "/home/mietvebp/www.mietvertrag.eu/cert/my-prvkey.pem";
# public certificate file to use
$MY_CERT_FILE = "/home/mietvebp/www.mietvertrag.eu/cert/my-pubcert.pem";
# Paypal's public certificate
$PAYPAL_CERT_FILE = "/home/mietvebp/www.mietvertrag.eu/cert/paypal_cert.pem";
# path to the openssl binary
$OPENSSL = "/usr/bin/openssl";
function paypal_encrypt($hash)
{
//Sample PayPal Button Encryption: Copyright 2006,2007 StellarWebSolutions.com
//Not for resale - license agreement at
//http://www.stellarwebsolutions.com/en/eula.php
global $MY_KEY_FILE;
global $MY_CERT_FILE;
global $PAYPAL_CERT_FILE;
global $OPENSSL;
if (!file_exists($MY_KEY_FILE)) {
echo "ERROR: MY_KEY_FILE $MY_KEY_FILE not found\n";
}
if (!file_exists($MY_CERT_FILE)) {
echo "ERROR: MY_CERT_FILE $MY_CERT_FILE not found\n";
}
if (!file_exists($PAYPAL_CERT_FILE)) {
echo "ERROR: PAYPAL_CERT_FILE $PAYPAL_CERT_FILE not found\n";
}
if (!file_exists($OPENSSL)) {
echo "ERROR: OPENSSL $OPENSSL not found\n";
}
//Assign Build Notation for PayPal Support
$hash['bn']= 'StellarWebSolutions.PHP_EWP';
$openssl_cmd = "$OPENSSL smime -sign -signer $MY_CERT_FILE -inkey $MY_KEY_FILE " .
"-outform der -nodetach -binary | $OPENSSL smime -encrypt " .
"-des3 -binary -outform pem $PAYPAL_CERT_FILE";
$descriptors = array(
0 => array("pipe", "r"),
1 => array("pipe", "w"),
);
$process = proc_open($openssl_cmd, $descriptors, $pipes);
if (is_resource($process)) {
foreach ($hash as $key => $value) {
if ($value != "") {
//echo "Adding to blob: $key=$value\n";
fwrite($pipes[0], "$key=$value\n");
}
}
fflush($pipes[0]);
fclose($pipes[0]);
$output = "";
while (!feof($pipes[1])) {
$output .= fgets($pipes[1]);
}
//echo $output;
fclose($pipes[1]);
$return_value = proc_close($process);
return $output;
}
return "ERROR";
};
?>
Fatal error: Call to undefined function paypal_encrypt() in /home/mietvebp/www.mietvertrag.eu/product.php on line 41