PHP: Verisign Payflow Pro functions - Manual
PHP  
downloads | documentation | faq | getting help | mailing lists | | php.net sites | links | my php.net 
search for in the  
<pdf_translatepfpro_cleanup>
view the version of this page
Last updated: Wed, 29 Jan 2003

LXXVIII. Verisign Payflow Pro functions

This extension allows you to process credit cards and other financial transactions using Verisign Payment Services, formerly known as Signio ().

These functions are only available if PHP has been compiled with the --with-pfpro[=DIR] option. You will require the appropriate SDK for your platform, which may be downloaded once you have registered.

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.

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 have been added in PHP 4.0.2.

참고: 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.

차례
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


User Contributed Notes
Verisign Payflow Pro functions
add a note add a note
john at webmeta dot com
29-Nov-2000 04:39

You can always vfork (backticks, exec, whatever) to call the pfpro executable.

The basic idea is that that is a dangerous and stupid way to use a product for which an SDK is freely available. The problem is that Verisign's (closed source) SDK uses its own SSL implementation that conflicts with OpenSSL (and probably others) when it is linked into Apache. This is crippling both to the usefulness of the SDK and hence that of this module.

You are encouraged to contact Verisign and urge them to provide a better SDK, an open-source SDK, or the implementation details so we can write our own.

bswenson at ku dot edu
27-Jun-2001 04: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.
ntemple at commercestore dot com
29-Aug-2001 03: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.

jason at thinkingman dot org
02-Dec-2001 10:01

[Ed Note:
If server is unavailable, file can be downloaded from

[email protected]]

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


gerry at ihigh dot com
27-Jun-2002 07: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 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 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 for the latest version of mod_ssl.

dcp at hps dot com
24-Sep-2002 11: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.

mike at 3mediaweb dot com
01-Dec-2002 06: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.

dennis at etinc dot com
03-Jan-2003 01:34

note that the payflow pro libraries have public symbols that conflict with the standard C library, and cause functions like sprintf to core dump if not compiled in properly. We got our ecommerce app to work by compiling it like so:

       cc -pthread -o app app.o $(MYSQLCLIB
) -lc_r -lpfpro

by explicitly linking the C lib before the pfpro library the function corruption does not occur.

I had many discussions with the boneheads at verisign but they do not have sufficient talent in their multi-billion $ organization to understand.

pfpro_rpm at operationblackhat dot com
03-Feb-2003 03:59

I have altered the redhat specs and created an rpm that builds the pfpro extensions, to make it easier, i built a pfpro rpm that installs the libraries and certs, it works quite well and keeps everything 'rpm' clean, and rpm verifiable. pretty much followed the original stuff. I am pretty impressed on how easy it integrated, since everyone was saying they were having problems. No problems what so ever.
mitka at actdev dot com
23-Feb-2003 05: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

Dimitri Tarassenko

marinne at irisweb dot com dot tw
09-May-2003 12:02

I managed to compile PHP 4.3.1 with pfpro support successfully under Mandrake Linux 9.1.

First download the Linux version of Payflow Pro SDK from Verisign Manager, put libpfpro.so and pfpro.h to some location (mine is /usr/local/lib).

My PHP configuration:

./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-pgsql=/usr/local/pgsql --with-pfpro=shared,/usr/local/lib --with-apxs2=/usr/local/apache2/bin/apxs

Then make and make install. In my exprience, the compilation was successfull, everything works fine but on the phpinfo() page I did not see the pfpro module, and none of those pfpro_xxx functions worked.

The problem lies in the php.ini setting. In php.ini you must edit the value of extension_dir and set it to a proper path. Mine is /usr/local/php/lib/php/extensions/no-debug-non-zts-20020429. This is where the file pfpro.so exists.

And the following line MUST be added to php.ini :

extension=pfpro.so

After adding these modifications, the pfpro module will appear on the phpinfo() page, and the related functions will work.

add a note add a note

<pdf_translatepfpro_cleanup>
 Last updated: Wed, 29 Jan 2003
show source | credits | mirror sites 
Copyright © 2001-2003 The PHP Group
All rights reserved.
This mirror generously provided by: /
Last updated: Fri May 23 21:10:19 2003 CEST