How Do I Use PayPal/Verisign PayFlow PRO With My Linux Shared Hosting Account?
Last Updated:
February 19, 2007 10:37 AM
In order to use PayPal/Verisign PayFlow PRO in your Linux hosting account you will need to add the following to your php5.ini file:
extension_dir=/usr/local/php5/lib/php/extensions
extension=pfpro.so
pfpro.proxyaddress=proxy.shr.secureserver.net
pfpro.proxyport=3128
extension=pfpro.so
pfpro.proxyaddress=proxy.shr.secureserver.net
pfpro.proxyport=3128
In any .php5 files that utilize PFpro functions (such as pfpro_process()), you will also need to put the following at the top of the file:
<? putenv("PFPRO_CERT_PATH=/usr/local/paypal/payflowpro/certs"); ?>
This would be an example test script (pfpro.php5):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<?php
pfpro_init();
$transaction = array('USER' => 'mylogin',
'PWD' => 'mypassword',
'PARTNER' => 'VeriSign',
'TRXTYPE' => 'S',
'TENDER' => 'C',
'AMT' => 1.50,
'ACCT' => '4111111111111111',
'EXPDATE' => '0904'
);
$response = pfpro_process($transaction);
if (!$response) {
die("Couldn't establish link to Verisign.n");
}
echo "Verisign response code was " . $response['RESULT'];
echo ", which means: " . $response['RESPMSG'] . "n";
echo "nThe transaction request: ";
print_r($transaction);
echo "nThe response: ";
print_r($response);
pfpro_cleanup();
?>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<?php
pfpro_init();
$transaction = array('USER' => 'mylogin',
'PWD' => 'mypassword',
'PARTNER' => 'VeriSign',
'TRXTYPE' => 'S',
'TENDER' => 'C',
'AMT' => 1.50,
'ACCT' => '4111111111111111',
'EXPDATE' => '0904'
);
$response = pfpro_process($transaction);
if (!$response) {
die("Couldn't establish link to Verisign.n");
}
echo "Verisign response code was " . $response['RESULT'];
echo ", which means: " . $response['RESPMSG'] . "n";
echo "nThe transaction request: ";
print_r($transaction);
echo "nThe response: ";
print_r($response);
pfpro_cleanup();
?>
</body>
</html>
NOTE:The test script should return a status of "1" - "unable to authenticate". This means the communications, the certificate and the pfpro module are working properly. The "unable to authenticate" message displays because the test script does not have a valid merchant login/password in it. For a more complete test you could insert your own merchant login information.
