|
I FOUND IT!!!!
Here's the code for all the other Windows 2000/2003 developers that need PHP support for Verisign's PayFlow Pro!
Make sure to download the Win32 SDK from the verisign manager site and install the COM component. Instructions are included in the download. Piece of cake really.
Then use the following code with PHP's support of COM to create a custom connection to Verisign's PayFlowPro. This will give you 100% control over look and feel issues and give a professional appearance.
Make sure to change the info in the connection to use your unique login for Verisign:
Although PHP is not officially supported at this time by VeriSign, it is possible to use PHP in conjunction with the COM client. Assuming the COM client has been successfully installed, the following code can be used as an example:
------------ BEGIN CODE SNIPPET ---------------
<?php
$objCOM = new COM("PFProCOMControl.PFProCOMControl.1");
$parmList = "TRXTYPE=S&TENDER=C&ZIP=12345&COMMENT2=PHP/COM Test Transaction"; $parmList .= "&ACCT=" . $_POST["cardNum"]; $parmList .= "&PWD=" . $_POST["userPW"]; $parmList .= "&USER=" . $_POST["userId"]; $parmList .= "&VENDOR=" . $_POST["vendorId"]; $parmList .= "&PARTNER=" . $_POST["partnerId"]; $parmList .= "&EXPDATE=" . $_POST["cardExp"]; $parmList .= "&AMT=" . $_POST["amount"];
$ctx1 = $objCOM->CreateContext("test-payflow.verisign.com", 443, 30, "", 0, "", ""); $result = $objCOM->SubmitTransaction($ctx1, $parmList, strlen($parmList)); $objCOM->DestroyContext($ctx1);
$valArray = explode('&', $result); foreach($valArray as $val) { $valArray2 = explode('=', $val); $response[$valArray2[0]] = $valArray2[1]; }
if ($response['RESULT'] == 0) { echo "<b>Success!</b><br><br>";
// or create a header call to success page encoding any params for display.
} else { echo "<b>Failure!</b><br><br>"; }
foreach($response as $name => $value) { echo "<b>$name</b> = $value<br>"; } ?>
------------ END CODE SNIPPET ---------------
|