PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  
<pdf_translatepfpro_cleanup>
view the version of this page
Last updated: Thu, 21 Aug 2003

LXXIX. Verisign Payflow Pro functions

Introduction

This extension allows you to process credit cards and other financial transactions using Verisign Payment Services, formerly known as Signio (http://www.verisign.com/products/payflow/pro/index.html).

When using these functions, you may omit calls to pfpro_init() and pfpro_cleanup() as this extension will do so automatically if required. However the functions are still available in case you are processing a number of transactions and require fine control over the library. You may perform any number of transactions using pfpro_process() between the two.

These functions were added in PHP 4.0.2.

Note: These functions only provide a link to Verisign Payment Services. Be sure to read the Payflow Pro Developers Guide for full details of the required parameters.

Note: This extension is not available on Windows platforms.

Requirements

You will require the appropriate SDK for your platform, which may be downloaded from within the manager interface once you have registered. If you are going to use this extension in an SSL-enabled webserver or with other SSL components (such as the CURL+SSL extension) you MUST get the beta SDK.

Once you have downloaded the SDK you should copy the files from the lib directory of the distribution. Copy the header file pfpro.h to /usr/local/include and the library file libpfpro.so to /usr/local/lib.

Installation

These functions are only available if PHP has been compiled with the --with-pfpro[=DIR] option.

Runtime Configuration

The behaviour of these functions is affected by settings in php.ini.

Table 1. Verisign Payflow Pro configuration options

NameDefaultChangeable
pfpro.defaulthost/PFPRO_VERSION < 3 "test.signio.com"PHP_INI_ALL
pfpro.defaulthost"test-payflow.verisign.com"PHP_INI_ALL
pfpro.defaultport"443"PHP_INI_ALL
pfpro.defaulttimeout"30"PHP_INI_ALL
pfpro.proxyaddress""PHP_INI_ALL
pfpro.proxyport""PHP_INI_ALL
pfpro.proxylogon""PHP_INI_ALL
pfpro.proxypassword""PHP_INI_ALL
For further details and definition of the PHP_INI_* constants see ini_set().

Resource Types

This extension has no resource types defined.

Predefined Constants

This extension has no constants defined.

Table of Contents
pfpro_cleanup -- Shuts down the Payflow Pro library
pfpro_init -- Initialises the Payflow Pro library
pfpro_process_raw -- Process a raw transaction with Payflow Pro
pfpro_process -- Process a transaction with Payflow Pro
pfpro_version -- Returns the version of the Payflow Pro software


add a note add a note User Contributed Notes
Verisign Payflow Pro functions
rrolfe at genpac dot com
07-Sep-2003 03:17
For everyone who needs this to work on FreeBSD 4.8 with php 4.3.3 (and for me next time i have to do it), please perform the following:

unpack the tar.gz file for php.
cd php-4.3.3/

and run the following  (as mentioned below):
perl -pi.bak -e  \
's/LIBS="-lpfpro/LIBS="-pthread -lpfpro/g' \
configure

Then run your configure script to include --with-pfpro.
Edit your Makefile and find the "COMMON_FLAGS" line and add -pthread to the end of it.

then run make and make install.

Also be sure to recompile your apache to include -pthread:
unpack apache
run your configure script
edit the src/Makefile and find the "LIBS1" line and add -pthread to the end of it.
then run make and make install.

for php to load on freebsd 4.8 as an apache module with pfpro, you *MUST* compile apache with -pthread.
bohemianadventurer at yahoo dot com
07-Jul-2003 11:45
I have been trying to compile PHP with PayFlow Pro support on FreeBSD 4.8-STABLE and I kept receiving this error:

The pfpro extension requires version 2 or 3 of the SDK

Looking at the config.log I found that the config test code was failing to compile with these errors:

/usr/local/lib/libpfpro.so: undefined reference to `pthread_mutex_unlock'
/usr/local/lib/libpfpro.so: undefined reference to `pthread_self'
/usr/local/lib/libpfpro.so: undefined reference to `pthread_mutex_destroy'
/usr/local/lib/libpfpro.so: undefined reference to `pthread_mutex_lock'
/usr/local/lib/libpfpro.so: undefined reference to `pthread_mutex_init'

With a little further digging, I determined the problem to be with the configure script.  The configure script is smart enough to test for POSIX threads, and to add the appropriate compile flag when building the PHP distribution, but it isn't smart enough to use that flag when compiling the config test code.  The pfp library requires the threads flag to be set.

This will kludge your configure script into working, so that you can get past the bogus error encountered by the pre-compile tests:

perl -pi.bak -e  \
's/LIBS="-lpfpro/LIBS="-pthread -lpfpro/g' \
configure

I broke it into three lines so that it doesn't wrap unhappily in this form.

NOTE:  This is the appropriate flag for FreeBSD 4.8.  Your system may require a different flag.

It is a kludge fix, and I'm not proud of it, but I have to have this damn thing working by morning.  :)

-Chris Knight
gbaratto at superb dot net
20-Jun-2003 03:21
if you are having problems compiling pfpro in freebsd 4.X, it is probably because of its braindead thread library.
Just install linuxthreads from the ports, set  LDFLAGS="-I/usr/local/include/pthread/linuxthreads -L/usr/local/lib -llthread -llgcc_r"
and then do as instructed in the other posts here.
mitka at actdev dot com
24-Feb-2003 02:45
You might want to check the CC number for LUHN checksum before submitting the actual transaction.

function luhncheck($number) {
    $l = strlen($number);
    for ($i=0; $i<$l; $i++) {
        $q = substr($number,$l-$i-1,1)*($i%2+1);
        $r += ($q%10)+(int)($q/10);
    }
    return !($r%10);
}

returns true if card number is valid, $number is a string with digits only (no dashes or spaces).

Before LUHN check, you can verify the card no. prefix and the number length, here's what they should be:

Visa: 4..., 16 digits
MC: 51-55..., 16 digits
Amex: 34... or 37..., 15 digits
Discover: 6011..., 16 digits.
Diners/CBlanche: 300-305..., 36..., 38..., 14 digits
JCB: 3..., 16 digits
JCB: 2131 or 1800, 15 digits
enRoute does not do LUHN verification.

See details at http://www.beachnet.com/~hstiles/cardtype.html

Dimitri Tarassenko
mike at 3mediaweb dot com
02-Dec-2002 03:59
After searching high and low for a way to get payflow pro to work with my existing servers (other than calling the pfpro binary), I found there was a way I could get it installed on my freebsd apache-mod_ssl servers. I did it via cgi version of php.
1. put freebsd version of libpfpro.so, and pfpro.h in one place.
    I chose /usr/local/lib/.
2. download the last version of php.

3.
./configure                              \
--prefix=/usr/local/php                  \
--with-config-file-path=/usr/local/php   \
--with-pfpro=shared,/usr/local/lib/      \
--enable-discard-path                    \
--with-mcrypt=/usr/local                 \
--with-mhash=/usr/local                  \
--with-mysql=/usr/local                  \
--with-expat-dir=/usr/local              \
--enable-wddx                            \
4.
make && make install ..
5.
copy php.ini-dist to your prefix'd location.
edit the safe modes and base directories and any other
security precautions you need.
I also put a link in /usr/bin/ to php so the paths would work.

6.
In your php file you will have to edit the loadable modules directory.
mine ended up being :
/path/lib/php/extensions/no-debug-non-zts-20020429/
browse down to the loadable extentions and add:
extension=pfpro.so
7.
Open up your httpd.conf add:
AddHandler cgi-script xphp
to a virtual host Directory or your cgi-bin:
I used xphp but you can use what you like for a file extention.

You can create a directory like /auth/ but then you will have to put a Options ExecCGI on that folder in order to execute the script.
8.
create a test.xphp file and put a #!/pathto/php before the <?
phpinfo
(); ?>
9. Restart apache to load the Directory directives, and open a browser and browse to the file.  If you see any headers on the top of the page, check your error log. if all goes smoothly you should'nt see any errors in the httpd-error_log. I like to tail -f http-error_log in one console and browse it in real time.

10. create a payflowpro.php in the same manner.
make sure you put a: putenv("PFPRO_CERT_PATH=/pathto/certs"); 
and try the pfpro_init(); function. if the function does'nt exist it will fail, which means you have to go back and check stuff for errors.
..
Warning: This is the way I found to get the job integrated. It may or may not work on all freebsd systems. Also keep in mind that the cgi version of the php scripts need to be chmod'd to the right permissions, safe_mode and disable functions that are not being used. 
It may not be the best way, but at least you still have access to the tools that php has build in.

..

If I missed something big here let me know.
dcp at hps dot com
25-Sep-2002 06:11
I finally got pfpro to work as an apache module. After following the advice above it still did not work. (Apache would not start with both the libssl and libphp4 added).
The solution is in the order in which apache web server loads modules. Review your httpd.conf file  typically located in /etc/httpd/conf. The loading of libssl.so and libphp4.so is important. The libssl.so must be loaded before libphp4.
gerry at ihigh dot com
28-Jun-2002 02:53
From Verisign's VPS support:

The Payflow Pro support in PHP must be configured/compiled as a shared object. In order to enable Payflow Pro support in PHP as a shared object, pass the following switch to the PHP ./configure script:

[root@localhost] # ./configure --with-pfpro=shared,/path/to/pfpro

The directory specified by /path/to/pfpro must contain *both* the libpfpro.so and pfpro.h files included in the Payflow Pro SDK (usually in the lib/ and/or bin/ subdirectories of the SDK), or the ./configure step will fail.
 
 
  Versions of PHP prior to 4.0.2 did not contain the pfpro support functions. See http://www.php.net/downloads.php for the latest stable version of PHP.

It appears to be impossible to use older versions of Apache in this sort of setup. Version 1.3.12 or greater are known to work, 1.3.9 may work, older versions reportedly do not work. See http://www.apache.org/dist/httpd/ for the latest stable version of Apache.

The version of mod_ssl is closely tied to the version of Apache being used; there are sometimes multiple versions of mod_ssl available for a single version of Apache. See http://www.modssl.org/source/ for the latest version of mod_ssl.
jason at thinkingman dot org
02-Dec-2001 07:01
[Ed Note:
If server is unavailable, file can be downloaded from
http://www.irc-html.com/pub/php_pfpro.zip
--irc-html@php.net]

You can download the complete php_pfpro.inc and php_pfpro_com.inc files from my FTP site.  They are WinZip'd.

ftp://ftp.thinkingman.org/pub/php/php_pfpro.zip
ntemple at commercestore dot com
29-Aug-2001 10:28
Please also be aware that forking will allow any person with the access to the ps command to potentially see ALL account information: user, password, partner, credit card number, etc.

The preferred way to use the module is through the now-fixed extension.
bswenson at ku dot edu
27-Jun-2001 11:57
If you decide not to use the pfpro functions for any one of several reasons and instead call the pfpro binary with the exec command please note that you must use the putenv function to set the environment variable PFPRO_CERT_PATH that is referred to in the PayFlowPro Developers Guide (see page 12).  Otherwise verisign with always return a -31 error - certificate not found.

<pdf_translatepfpro_cleanup>
 Last updated: Thu, 21 Aug 2003
show source | credits | sitemap | mirror sites 
Copyright © 2001-2003 The PHP Group
All rights reserved.
This mirror generously provided by: http://php.mirrors.ilisys.com.au/
Last updated: Sat 01 Nov 2003 04:13:36 EST EST