|
|
 |
LXXXI. Verisign Payflow Pro FunctionsIntroduzione
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.
Nota:
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.
Nota: Questo modulo non è
disponibile su piattaforme Windows.
Requisiti
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.
Installazione
These functions are only available if PHP has been compiled with the
--with-pfpro[=DIR] option.
Configurazione di Runtime
Il comportamento di queste funzioni è influenzato dalle impostazioni di php.ini.
Tabella 1. Verisign Payflow Pro configuration options | Name | Default | Changeable |
|---|
| 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().
Tipi di risorseQuesta estensione non definisce alcun tipo di risorsa. Costanti predefiniteQuesta estensione non definisce alcuna costante.
add a note
User Contributed Notes
Verisign Payflow Pro Functions
cfischer17 at acm dot org
15-Apr-2004 04:36
ng4rrjanbiah at rediffmail dot com
16-Dec-2003 07:49
maw at synesis dot net
21-Nov-2003 09:24
I can confirm that the undefined references (__ctype_b) bug referred to in the previous note is indeed fixed by using the Versign SDK for Redhat 9.
It all works fine on Redhat 9 + glibc 2.3.2 + Apache 2.0.48 + PHP 4.3.4.
Just FYI, this is all because __ctype_b has been replaced by __ctype_b_loc in glibc 2.3. Here's the quote from Bug #91290 on bugzilla.redhat.com: "For __ctype_b*, the decision to replace it by __ctype_b_loc etc. and disallow any new links against the old type were made because __ctype_b* does not work together with uselocale(3).These days, uselocale(3) is used quite often e.g. in libstdc++, so it is very bad idea to keep using __ctype_b etc." In a nutshell this means that old libraries linked against glibc < 2.3 should be rebuilt with glibc >= 2.3 if they use any of these symbols. This Verisign has done with the RH9 version of the SDK.
19-Nov-2003 11:00
Redhat 9 compile problems.
Redhat 9's version of glibc will cause compile to fail. It seems that for localization reasons RH started using __ctype_b_loc instead of __ctype_b, which is what payflow is expecting. Not that I know what this means, but it's attested to at http://kb.verisign.com, if you search for "redhat 9", and there is a bug at http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=86465 about it. Redhat is not going to fix it, so you have to get the beta sdk from verisign. Or use something besides Redhat 9.
freebsd at argentproductions dot com
04-Nov-2003 05:02
A comment on the below notes regarding compilation on FreeBSD... to bring this up-to-date:
It seems Verisign is up to version 3.06 as of 3 Nov 2003, and at least on FreeBSD 5.1-RELEASE no special actions are necessary to get these functions to compile properly on PHP 4.3.3 or later (also tried on 4.3.4). I used the listed notes above (download and copy the two files in place, add --with-pfpro=/usr/local to the ./configure options, and off you go) and the module compiled, installed, and ran just fine on a standard port-built apache server. So if you are running FreeBSD 5.1 or later and have the updated Verisign and PHP code, you should have no problems.
rrolfe at genpac dot com
06-Sep-2003 07: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 03: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
19-Jun-2003 07: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
23-Feb-2003 04: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
01-Dec-2002 05: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
24-Sep-2002 10: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
27-Jun-2002 06: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 09:01
ntemple at commercestore dot com
29-Aug-2001 02: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 03: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.
| |