Re: ** BUG ** PAYFLOWPRO Extension Missing or Not Working for Win32
| From: | Jason Caldwell | Date: | Fri, 05 Oct 2001 22:16:26 +0000 |
| Subject: | Re: ** BUG ** PAYFLOWPRO Extension Missing or Not Working for Win32 | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-67385@lists.php.net to get a copy of this message | ||
I've written a solution for Win32 Users, until the PHP_PFPRO.DLL is
released. This is totally workable.
<?
/* PayFlowPro Solution for Win32 Users using PHP 4.0.6 (and lower.)
----------------------------------------------------------------------
As of this publishing -- the Win32 version of PHP (up to 4.0.6)
doesn't seem to support Verisign's PayflowPro Service / SDK through
an extension (such as; PHP_PFPRO.DLL) -- I hope to see this extension
released *soon*. In the meantime, here is a workable solution for Win32
Users / Developers.
by Jason Caldwell (jason@thinkingman.org) (10-05-2001) */
/* Make sure the environment variable PFPRO_CERT_PATH = {the Cert Path} is
set.
(for example: PFPRO_CERT_PATH = C:\Verisign\payflowpro\win32\certs) */
$result = exec('C:\Verisign\payflowpro\win32\bin\pfpro
test-payflow.verisign.com 443
"TRXTYPE=S&TENDER=C&PWD=yourPassword&USER=yourUsername&VENDOR=yourUsername&P
ARTNER=yourPartnerName&ACCT=4222222222222&EXPDATE=1209&AMT=14.42&COMMENT1=12
3456789&COMMENT2=Good Customer&INVNUM=1234567890&STREET=5199
JOHNSON&ZIP=94588" 5');
$valArray = explode('&', $result);
foreach($valArray as $val)
{
$valArray2 = explode('=', $val);
$pfpro[$valArray2[0]] = $valArray2[1];
}
/* To look at the array structure */
print_r($pfpro);
?>
Jason
jason@thinkingman.org
"Jason Caldwell" <jason@thinkingman.org> wrote in message
news:20011005171950.82444.qmail@pb1.pair.com...
> ** BUG ** PAYFLOWPRO Extension Missing or Not Working for Win32 (4.0.6)
> version of PHP.
>
> The following code from the Online PHP Manual (from www.php.net) generates
> the following error when run.
>
> [ ---- / CODE / ---- ]
> <?php
>
> pfpro_init();
>
> $transaction = array(USER => 'myUserName',
> PWD => 'myPassword',
> 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();
>
> ?>
>
> [ ---- / ERROR GENERATED / ---- ]
> Call to undefined function: pfpro_init()
>
> If someone could please fix this as soon as possible -- thanks. :-)
>
> Jason Caldwell
> jason@thinkingman.org
>
>
>