note 34211 added to ref.pfpro
| From: | alek at balara dot sk | Date: | Fri, 18 Jul 2003 12:52:37 +0000 |
| Subject: | note 34211 added to ref.pfpro | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-52335@lists.php.net to get a copy of this message | ||
I am using Windows 2K for development of my PHP scripts and then I distribute them usually on the
Linux/UNIX web servers. I try to simulate the same PHP configuration when I develop my scripts.
For PayFlow Pro it is said there is no extension available on Windows platform. Here is how I made
it working on Windows platform:
a) you have to signup for free 30 day payment trial account in order to get SDK and to have a test
account. Here is link http://www.verisign.com/products/payflow/pro/index.html
b) log in to your account and in Downloads section download pfpro_win32.zip SDK and then install COM
version from pfpro_win32.zip -> verisign/payflowpro/win32/com according to instructions in
readme.txt file.
I re-wrote ASP example to PHP using COM class. It perfectly works. Here is sample code:
NOTE: do not forget to replace <yourUserName> and <yourPassword> in transaction string
with your real values
<?
/*
PHP/COM Client Integration Example
You must install the Payflow Pro COM Client before you can
successfully run this example.
*/
?>
<html>
<head>
<title>V3ComExample.php File</title>
</head>
<body BGCOLOR="#FFFFFF">
<font FACE="ARIAL,HELVETICA"><?
// create the PNCOMClient component
$client = new COM("PFProCOMControl.PFProCOMControl.1");
//build the parameter list, such that we have a sale transaction and
//a credit card tender.
$parmList = "USER=<yourUserName>&".
"VENDOR=<yourUserName>&".
"PARTNER=VeriSign&".
"PWD=<yourPassword>&".
"TRXTYPE=S&".
"TENDER=C&".
"ACCT=4111111111111111&".
"EXPDATE=1209&".
"AMT=27.23";
echo str_replace("&", < br >", $parmList)."<br>";
$Ctx1 = $client->CreateContext("test-payflow.verisign.com", 443, 30, "", 0,
"", "");
$curString = $client->SubmitTransaction($Ctx1, $parmList, strlen($parmList));
$client->DestroyContext ($Ctx1);
// handle the response
echo "<hr><p>".str_replace("&", "< br >",
$curString);
?>
</font>
</body>
</html>
Maybe it is obvious for most of programmers, but it was not for me. I hope it helps!
----
Manual Page -- http://www.php.net/manual/en/ref.pfpro.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34211
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34211&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34211&report=yes