PHP: pfpro_process - Manual

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

search for in the

pfpro_version pfpro_process_raw

Last updated: Sat, 27 Jan 2007

view this page in

# pfpro_process

(PHP 4 >= 4.0.2, PHP 5)

pfpro_process -- Process a transaction with Payflow Pro

## Описание

array pfpro_process ( array parameters [, string address [, int port [, int timeout [, string proxy_address [, int proxy_port [, string proxy_logon [, string proxy_password]]]]]]] )

pfpro_process() processes a transaction with Payflow Pro.

> Замечание: Be sure to read the Payflow Pro Developers Guide for full details of the required parameters.

## Список параметров

`parameters`

  An associative array containing keys and values that will be encoded and passed to the processor.

`address`

  Specifies the host to connect to. By default this is `test.signio.com`, that you will certainly want to change this to `connect.signio.com` in order to process live transactions.

`port`

  Specifies the port to connect on. It defaults to 443, the standard SSL port number.

`timeout`

  Specifies the timeout to be used, in seconds. This defaults to 30 seconds. Note that this timeout appears to only begin once a link to the processor has been established and so your script could potentially continue for a very long time in case of DNS or network problems.

`proxy_address`

  If required, specifies the hostname of your SSL proxy.

`proxy_port`

  If required, specifies the port of your SSL proxy.

`proxy_logon`

  If required, specifies the logon identity to use on the SSL proxy.

`proxy_password`

  If required, specifies the password to use on the SSL proxy.

## Возвращаемые значения

Returns an associative array of the keys and values in the response.

## Примеры

Пример 1. Payflow Pro example

`<?php
pfpro_init();
$transaction = array('USER' => 'mylogin',
'PWD' => 'mypassword',
'PARTNER' => 'VeriSign',
'TRXTYPE' => 'S',
'TENDER' => 'C',
'AMT' => 1.50,
'ACCT' => '4111111111111111',
'EXPDATE' => '0909'
);
$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();
?>`

add a note User Contributed Notes
pfpro_process
php at spamisbad dot markjrubin dot com
24-Mar-2005 09:12
`Regarding glaw at thebook dot com's comment.
There is another solution.
Determine where the actual certificate is (/usr/local/verisign/payflowpro/linuxrh9/certs for example).
The pfpro_process function looks for certificates in PFPRO_CERT_PATH if it's been set but *also* looks in the current directory for a folder named certs.
Create a symbolic link to the actual certificate folder.
-sh-2.05b$ cd httpsdocs/
-sh-2.05b$ ln -s /usr/local/verisign/payflowpro/linuxrh9/certs certs
This worked for me.
Regards,
Mark J Rubin`
glaw at thebook dot com
23-Jun-2003 12:33
`The following:
putenv("PFPRO_CERT_PATH=/path/to/certs/");
doesn't work if you have safe mode on.
One way around this is to put the following in your
apache <virtualhost> block:
SetEnv PFPRO_CERT_PATH /path/to/certs/
If you don't have access to this, ask your sys admin`
jb at greendogfilm dot com
23-Jun-2003 12:44
`A quick addition to ewtNOSPAM at macNOSPAM dot com
note above about including VENDOR to the array. One must also include the PARTNER name value pair as well. This annoying little tidbit was only found after calling Verisign to see why the User Authentication error was continually being received. The default value (for now) for PARTNER is the username. Cute, eh?`
php at burntpopcorn dot net
14-May-2003 07:03
`a "drop in" replacement for pfpro_process for windows using the pfpro.exe file. It saves having to migrate to unix for payflo support (no matter how much I want to migrate to unix) :)
doesn't support the proxy stuff because I'm not entirely sure how they work, and we don't have a proxy so they aren't worth implementing. Good luck.
function pfpro_process($params, $server, $port, $timeout) {
$str = "";
foreach ($params as $key=>$value) {
$str .= ($str?"&":"").$key."=".$value;
}
$pfprodir = "c:\\payflo\\verisign\\payflowpro\\win32\\certs";
putenv("PFPRO_CERT_PATH=$pfprodir");
$pfret = `c:\payflo\verisign\payflowpro\win32\bin\pfpro $server $port "$str" $timeout`;
$results = array();
$keyvalues = explode("&", $pfret);
foreach ($keyvalues as $keyvalue) {
$temp = explode("=", $keyvalue);
if (count($temp) == 2) {
$results[$temp[0]] = $temp[1];
}
}
return $results;
}`
ewtNOSPAM at macNOSPAM dot com
05-Aug-2002 04:54
`If you get the response "Verisign response code was -31, which means: The certificate chain did not validate, no local certificate found," then you must set the environment variable PFPRO_CERT_PATH to point to the directory that contains the file f73e89fd.0.
One way to do this is to include the following right before calling pfpro_process:
<?php
putenv("PFPRO_CERT_PATH=/path/to/certs/");
?>
In my Linux installation, that path is /usr/local/verisign/payflowpro/linux/certs/`
php_at_chikki_dot_net
21-May-2002 02:35
`When using the transaction, dont forget to include the PARTNER tag - otherwise you will get a code 1 return: User authentication failed.
so the full $transaction Array as given above will be:
$transaction = array(USER => 'mylogin',
PWD => 'mypassword',
PARTNER => 'VeriSign',
TRXTYPE => 'S',
TENDER => 'C',
AMT => 1.50,
ACCT => '4111111111111111',
EXPDATE => '0904'
);
The default partner is VeriSign.
Please note you may also have to copy the cert to a certs/ directory (with respect to where the script is executed)`
tjw at webteam dot net
05-Jun-2001 10:22
`4.0.6RC2 uses 'test.signio.com' as the pfpro.defaulthost.
That host doesn't appear to work anymore. Instead, use 'test-payflow.verisign.com'.
$response = pfpro_process($transaction, "test-payflow.verisign.com");`
add a note
pfpro_version pfpro_process_raw

Last updated: Sat, 27 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 10:36:09 2007 PST