note 40619 deleted from ref.cybercash by philip
| From: | philip@php.net | Date: | Fri, 28 Nov 2008 19:57:51 +0000 |
| Subject: | note 40619 deleted from ref.cybercash by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-147171@lists.php.net to get a copy of this message | ||
Note Submitter: david at azcode dot com
----
I am suprised to see recent posting for CyberCash implementation considering they haven't been
a company for almost four years now. When VeriSign bought them, they force migrated everyone to
Payflow Pro - which is why I switched to iBill.com (now InterCept's iPay) gateway. Either way,
the below code (using cURL) should allow a transaction to post without a local COM obj to a secure
payment server via SSL. check it out...
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://secure.ibill.com/cgi-win/ccard/tpcard.exe");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // this line make is work under https
curl_setopt($ch, CURLOPT_TIMEOUT, 90);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_SSLVERSION, 3);
$RECEIPT = curl_exec($ch);
$RECEIPT = preg_replace("/\n?\r?/","",$RECEIPT);
curl_close ($ch);
$receipt_fields = preg_split("/\",\"/", $RECEIPT, -1, PREG_SPLIT_NO_EMPTY);
$authorization = $receipt_fields[0];
$authorization = preg_replace("/]^a-z0-9]/i","",$authorization);
$authcode = $receipt_fields[1];
$rDate = $receipt_fields[2];
$rTime = $receipt_fields[3];
$rTran = $receipt_fields[4];
$rcRef = $receipt_fields[5];
$avscode = $receipt_fields[6];
$psdata = $receipt_fields[7];
if(!isset($receipt_fields[8])) {
$revsh = "none";
}else { $revsh = $receipt_fields[8]; }
if(!isset($receipt_fields[9])) {
$fraud = "none";
}else { $fraud = $receipt_fields[9]; }