Secure EBS Payment Gateway Integration in Magento

Steps for Integrating Secure EBS Payment Gateway in Magento :

Secure EBS payment Gateway is default Module in Magento. Despite below, steps are help for Understanding or How module is integrated in magento.

You can download the module from below link

https://support.ebs.in/app/index.php?/default_import/Knowledgebase/Article/View/226/7/magento-15-ebs-integrationkit-ver-25

( I ) Follow Below steps :

1)      Copy the folder Secureebs to magento\app\code\core\Mage\

2)      Copy the file Mage_Secureebs.xml to magento\app\etc\modules\

3)      Copy the folder secureebs to magento\app\design\frontend\base\default\template\

4)      Add the file Mode.php inside magento\app\code\core\Mage\Adminhtml\Model\System\Config\Source\

5)      Enter your Account Id , Secret Key and select the Mode from the EBS Payment Method control panel & Enable it.

 ( II ) Finally Need to update below file otherwise we will get Error :

Open File   \app\code\core\Mage\Secureebs\Block\Standard\Redirect.php

( III ) Below code is default code in redirect.php :

$name=$fname.” “.$lname;

$address=$street.”,”.$city.”,”.$state;

$mode=Mage::getSingleton(‘secureebs/config’)->getTransactionMode();

if($mode == ‘1’)

{

$mode=”TEST”;

}

else

{

$mode=”LIVE”;

}

 Customize code : (Here we need to add below code)

$secretKey = Mage::getSingleton(‘secureebs/config’)->getSecretKey(); // Our SecretKey

$account_id = Mage::getSingleton(‘secureebs/config’)->getAccountId(); //account ID

$amt = $amount;

$refrence_no = $referenceno;

$return_url = $returnurl;

$mode = $mode;

 $string = “$secretKey|$account_id|$amt|$refrence_no|$return_url|$mode”;  // Should add ” | ” between parameters

 $secure_hash = md5($string); // Encrypt MD5 format

$form->addField(‘reference_no’, ‘hidden’, array(‘name’=>’reference_no’, ‘value’=>$referenceno));

$form->addField(‘amount’, ‘hidden’, array(‘name’=>’amount’, ‘value’=>$amount));

$form->addField(‘mode’, ‘hidden’, array(‘name’=>’mode’, ‘value’=>$mode));

$form->addField(‘return_url’, ‘hidden’, array(‘name’=>’return_url’, ‘value’=>$returnurl));

$form->addField(‘name’, ‘hidden’, array(‘name’=>’name’, ‘value’=>$name));

$form->addField(‘description’, ‘hidden’, array(‘name’=>’description’, ‘value’=>$desc));

$form->addField(‘address’, ‘hidden’, array(‘name’=>’address’, ‘value’=>$address));

$form->addField(‘postal_code’, ‘hidden’, array(‘name’=>’postal_code’, ‘value’=>$postalcode));

 $form->addField(‘secure_hash’,’hidden’,

array(‘name’=>’secure_hash’, ‘value’=>$secure_hash)); // this line need to add

( IV ) Enable Module from Admin panel :

After integrate this module , open magento admin panel , then enable Secure EBS Payment Gateway, and pass your secret Key and account ID.

All the Best 🙂