Last updated on the 28th. August 2020 at 5:14 p.m.

In this lesson I will explain how we can integrate ICICI bank’s Eazypay payment gateway into our PHP web application. The Eazypay payment portal has been created by ICICI bank, which helps you to pay your bills easily, whether it concerns education, housing corporations or other accounts. You can pay your bills in cash, by cheque, by RTGS, by NEFT, by bank account or by card.


You must have an EazyPay account before you can integrate your web application.

Once you have successfully registered your Eazypay account, you will receive detailed account information at the email address you provided during registration. You must encrypt the data with the key you receive by email and open this link in your browser. To open the eazypay payment gateway you now need to pass certain required parameters to the URL.

Below is a list of the parameters required for the payment request.





Settings Description Obligatory website
default URL Yes
Dealer identification 100011 Yes
Dealer reference number
Clutch number. 8001 Yes
Identification code of the sub-dealer 1234 Yes
Transaction amount 80 Yes
decryption key
Method of payment 9 Yes
return URL
Additional Field

For the coding:- fields=8001|1234|80| 9000000001&optional fields=20|20|20&returnurl= No=8001&submerchantid=1234&submerchantid=80&paymode=9.

After encryption: – fields=u65A+ywICIypesJVQp9ED2VlkBzkIimiHhLXPyo2P14=&optional fields=faJ6BJUlOqjoV/AEbw5X4g=&Return=6WvzNalyXvqOX+aY9ee5oKm8FT+YUF5sz940o6QZvx0=&Report. No=X7VX+1ZnKq+o6K2QWCTERQ==&Output=QVZkBomDLSbitS4C9lGaUA==&Transaction Amount=aTRTaIdS0sLyzGCxL3Y5dQ==&Payment Mode=nFRjDWSCg 0aUYivDlqw==&payment method.

You can use the function below to encrypt your data and set this encrypted data in your URL.

private function aes128Encrypt($str, $key){$block = mcrypt_get_block_size(‘rijndael_128’, ‘ecb’);$pad = $block – (strlen($str) % $block);$str .= str_repeat(chr($pad), $pad);returns basic64_encode(mcRYPT_RIJNDAEL_128, $key, $str, MCRYPT_MODE_ECB);}.

To generate a link, use the code below

$optionalField = $this->aes128Encrypt($optionalField, $encryption_key);
$amount = $this->aes128Encrypt($this->aes128Encrypt($this->encrypt_key);
$reference_no = $this->aes128Encrypt($reference_no, $encryption_key) ;
$return_url = $this->aes128Encrypt($return_url, $encryption_key);
$sub_merchant_id = $this->aes128Encrypt($sub_merchant_id, $encryption_key);
$paymode = $this->aes128Encrypt($paymode, $encryption_key) ;

$url = $default_url.merchantid=.$merchant_id.&mandatory fields=.$manatoryField.&optional fields=.$optionalField.&returnurl=.$return_url.&reference no=.$reference_no.&submerchantid=.$sub_merchant_id.&transaction amount=.$amount.$.&paymode=.$paymode ;

Or, if you like OOPS, you can use this course.

Eazypay ICICI

Eazypay class
public $merchant_id;
public $encryption key;
public $sub_merchant_id;
public $reference_no;
public $paymode;
public $return_url ;

const DEFAULT_BASE_URL = ‘ ?

public function __construct()
$this->merchant_id = ‘KEY_MAIL’ ;
$this->encryption key = ‘KEY_MAIL’ ;
$this->sub_merchant_id = ‘KEY_MAIL’ ;
$this->merchant_reference_no = ‘KEY_MAIL’;
$this->paymode = ‘9’;
$this->return_url = ‘YOURN_URL’;

public function getPaymentUrl($amount, $Reference_no, $optionalField=zero)
$mandatoryField = $this->getMandatoryField($amount, $Reference_no) ;
$optionalField = $this->getOptionalField($optionalField);
$amount = $this->getAmount($amount);
$reference_no = $this->getReferenceNo($reference_no) ;

$paymentUrl = $this->generatePaymentUrl($ mandatoryField, $optionalField, $amount, $reference_no);
$paymentUrl return;
// return redirect()->to($paymentUrl);

protected function generatePaymentUrl($mandatoryField, $optionalField, $amount, $reference_no)
$encryptedUrl = itself::DEFAULT_BASE_URL.merchantid=.$this->merchant_id.&mandatory fields=.$mandatoryField.&OptionalFields=.$optionalField.&returnurl=.$this->getReturnUrl().&Reference No=.$reference_no.&submerchantid=.$this->getSubMerchantId().&deal amount=.$amount.&paymode=.$this->getPaymode() ;

Fee $verschlüsselteUrl;

secure function getMandatoryField($ amount, $reference_no)
gives $this->getEncryptValue($reference_no.’|’.$this->sub_merchant_id.’|’.$amount);

// the optional field must be separated from |, e.g. (20|20|20)
protected function getOptionalField($optionalField=null)
if (!is_null($optionalField))
returns $this->getEncryptValue($optionalField);
returns zero;

protected function getAmount($amount)
gives $this->getEncryptValue($amount);

protected getReturnUrl() function
returns $this->getEncryptValue($this->return_url);

protected function getReferenceNo($reference_no)
gives $this->getEncryptValue($reference_no);

protected getSubMerchantId() function
returns $this->getEncryptValue($this->sub_merchant_id);

protected getPaymode() function
gives $this->getEncryptValue($this->paymode);

// use @ to avoid the php warning

secure function getEncryptValue($str)
$block = @mcrypt_get_block_size (‘rijndael_128’, ‘ecb’) ;
$pad = $block – (strlen($str) % $block) ;
$str .= str_repeat(chr($pad), $pad) ;
get basic64_encode(@mcrypt_RIJNDAEL_128, $this->encryption_key, $str, MCRYPT_MODE_ECB)) ;
} ; .


And after you add this class, you can

$amount = 11 ;
$reference_no = rand() ;
// call method
$base=new Eazypay() ;
$url=$base>getPaymentUrl($amount, $reference_no, $optionalField=null)

Once you have a URL, you can click on your URL and forward it to the Eazypay ICICI site using the code below


Unless you redirect the click here.

I hope you enjoyed the news. Don’t forget to subscribe to my Youtube link at the top of the page.

jeremy griggs,geeks and gamers alt-right,geeks and gamers youtube,geeks and gamers website,geeks and gamers twitch,geek and gamer mystery box,geekss twitter,geeks and gamers jeremy email,worldclassbs twitter,geeks and gamers anna,odins movie blog twitter,geeks and gamers jessi,geeks and gamers wiki,geeks and gamers store,geeks and gamers instagram,geeks + gamers reddit,mulan cartoon vs live-action characters,mulan 1998 vs mulan 2020,mulan live action 2009,mulan 2020 dragon,mulan 2020 controversy,kung fu mulan,i'm thinking of ending things ice cream,i'm thinking of ending things reddit,i'm thinking of ending things book,i'm thinking of ending things poem,i'm thinking of ending things screen ratio,i'm thinking of ending things parents guide,geeks + gamers toxic,geeks and gamers jeremy griggs,geeks and gamers net worth,geeks and gamers members,geeks and gamers twitter

You May Also Like

🥇 Calculate the Cost of a Product in Excel  Step by Step Guide ▷ 2020

If you want to sell a product or offer a service to…

🥇 MICROSOFT POWERPOINT  What is it? + Alternatives ▷ 2020

One of the advantages of using Office software packages is that you…

Pytorch Image Augmentation using Transforms.

In-depth learning models generally require a lot of data for learning. In…

Fix: Google Photos not backing up on iPhone

For many iPhone users, Google Photos remains the first choice, even though…