Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Verus Payment Gateway


esilk

Recommended Posts

Here is the integration documentation provided by Verus. My question is still this:

How do I integrate this into the checkout procedure in OSC so that the checkout continues with an approved transaction or shows an error screen if an error is returned.

 

Also, I need to know how to integrate the Approval Code and Reference Number into the invoice and email sent by OSC on final approval.

 

If someone knows how to do this I may be able to have the client pay to have this done....but he is on a very limited budget.....

 

PHP Sample

If you wish to perform a bankcard transaction from within a PHP environment then we recommend using the CURL library. It can be used in two forms, the preferred, internal method and the external executable. In order to use the internal method the version of PHP installed on your machine needs to have been compiled with --with-curl (see PHP.net for details). If your vendor has not provided this and you cannot compile and install PHP yourself then you can use the curl executable from within PHP. This is less efficient and you must take care when exposing a command line in this fashion. All that is needed for this method is to have a working curl executable installed on the server. While other methods exist for doing an HTTPS POST in PHP, this is a relatively simple method that we will support.

<?

//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 17 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. Comment out the above 8 lines and uncomment the 5 lines below:

//$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";

?>

Link to comment
Share on other sites

  • 1 month later...
Here is the integration documentation provided by Verus. My question is still this:

How do I integrate this into the checkout procedure in OSC so that the checkout continues with an approved transaction or shows an error screen if an error is returned.

 

Also, I need to know how to integrate the Approval Code and Reference Number into the invoice and email sent by OSC on final approval.

 

If someone knows how to do this I may be able to have the client pay to have this done....but he is on a very limited budget.....

 

PHP Sample

If you wish to perform a bankcard transaction from within a PHP environment then we recommend using the CURL library. It can be used in two forms, the preferred, internal method and the external executable. In order to use the internal method the version of PHP installed on your machine needs to have been compiled with --with-curl (see PHP.net for details). If your vendor has not provided this and you cannot compile and install PHP yourself then you can use the curl executable from within PHP. This is less efficient and you must take care when exposing a command line in this fashion. All that is needed for this method is to have a working curl executable installed on the server. While other methods exist for doing an HTTPS POST in PHP, this is a relatively simple method that we will support.

<?

//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 17 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. Comment out the above 8 lines and uncomment the 5 lines below:

//$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 would to like to see a module for this as we use Sage and need something that will be able to interact with our accounts :thumbsup:

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...