New Zenner
- Join Date:
- Aug 2006
- Posts:
- 28
- Plugin Contributions:
- 0
How to make a payment module???
Ok I have tried searching and going through all sorts of threads getting this thing to work and it still doesn't the documentation for integration for Verus Card Services reads as follows:
<?
//set the URL that will be posted to.
$eftsecure_url = "https://va.eftsecure.net/cgi-bin/eftbankcard.dll?transaction";
//make your query.
$data = "m_id=" . $mid; //your eftsecure merchant id.
$data .= "&m_key=" . $mkey; // your eftsecure merchant key;
$data .= "&T_amt=" . urlencode($amount); // The amount to be charged. Always encode
// any data given to you over the web. it is more
// secure and reliable.
$data .= "&C_name=" . urlencode($cardholder_name);
$data .= "&C_address=" . urlencode($billing_address);
$data .= "&C_state=" . urlencode($billing_state);
$data .= "&C_city=" . urlencode($billing_city);
$data .= "&C_cardnumber=" . urlencode($cardnumber);
$data .= "&C_exp=" . urlencode($exp_Date);
$data .= "&C_zip=" . urlencode($billing_zip);
$data .= "&C_email=" . urlencode($email_addr);
$data .= "&T_code=02"; // transaction type indicator
//now we will make the transaction. the first method is the preferred internal method
//using the built in CURL functions.
$ch = curl_init(); //initialize the CURL library.
curl_setopt($ch, CURLOPT_URL, $eftsecure_url); // set the URL to post to.
curl_setopt($ch, CURLOPT_POST, 1); // tell it to POST not GET (you can GET but POST is
//preferred)
curl_setopt($ch, CURLOPT_POSTFIELDS, $data); // set the data to be posted.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // this tells the library to return the
// data to you instead of writing it to
// a file
$res = curl_exec($ch); // make the post.
curl_close($ch); // shut down the curl library.
echo $res . "<br>\n"; // this is the response.
// or you can also use the curl executable directly.
$curl = "/usr/bin/curl"; // the location of the curl executable.
$fp=popen("$curl --data "$data" $eftsecure_url","r"); // this allows you to get the
// data directly from curl
while(!feof($fp)) $res .= fread($fp, 1024); // read all the output.
pclose($fp); // close the connection to curl.
echo "$res" . "<br>\n"; // this is the response.
// once you have the response then you need to parse its different components.
echo "<br><hr><br>\n";
echo "Approval Indicator: " . $res[1] . "<br>"; //A is approved E is declined/error.
echo "Approval/Error Code: " . substr($res, 2, 6) . "<br>\n";
echo "Approval/Error Message: " . substr($res, 8, 32) . "<br>\n";
echo "Front-End Indicator: " . substr($res, 40, 2) . "<br>\n";
echo "CVV Indicator: " . $res[42] . "<br>\n";
echo "AVS Indicator: " . $res[43] . "<br>\n";
echo "Risk Indicator: " . substr($res, 44, 2) . "<br>\n";
echo "Reference: " . substr($res, 46, 10) . "<br>\n";
echo "Order Number: " . substr($res, strpos($res, chr(28)) + 1,
strrpos($res, chr(28) - 1)) . "<br>\n";
?>
I've tried plugging this in and all I get is a secruity error--I need help here...