#PersianBank
perisan bank plugin for cakephp This Plugin is made for interacte with Persian bank in this plugin we make all bank access for any cakephp program
- Parsian
- Melat (Comming Soon)
- Tejarat (Comming Soon)
The master branch has the following requirements:
- CakePHP 2.2.0 or greater.
- PHP 5.3.0 or greater.
- Clone/Copy the files in this directory into
app/Plugin/PersianBank
This can be done with the git submodule command
git submodule add https://github.com/moharami/PersianBank app/Plugin/PersianBank
- Ensure the plugin is loaded in
app/Config/bootstrap.php
by callingCakePlugin::load('PersianBank', array('bootstrap' => true, 'routes' => false));
- in the PersianBank Plugin Config/bootstrap.php you must add your setting
Configure::write(
'Parsian',
array(
'try_again' => array('plugin' =>'payments' ,'controller' => 'PaymentAccountNumbers' , 'action' => 'list' , 'admin'=>true),
'return_url' => array('plugin' =>'payments' ,'controller' => 'PaymentAccountNumbers' , 'action' => 'bank_result' , 'admin'=>true),
'PIN' => 'your pin ...........',
)
);
- try_again : this url is your payment page, if something wrong during payment , we get back user to the payment page
- return_url : after user paid correctly the authority key get back to this url
- PIN : this is your pin that you recive from bank - this pin is unique and it set to your ip address that you send to parsian bank
/**
* admin_send_to_bank method
*
* @return void
*/
public function admin_send_to_bank(){
$price = 1000; //Rials
$this->Session->write('amount', $price);
$this->redirect(array('plugin'=>'persian_bank', 'controller' => 'Parsians', 'action' => 'gotoParsian'));
}
/**
* bank_result method
*
* @return void
*/
public function admin_bank_result(){
$authority = $this->Session->read('authority');
// this authority is successfull paid - please attention delete this session(authority) after save your data in database
// save data in database
}
documentaion that i reciver from parsian bank is placed in Vendor/Documentation/Parsian
- in the PersianBank Plugin Config/bootstrap.php you must add your setting
Configure::write(
'Mellat',
array(
'try_again' => array('plugin' =>'payments' ,'controller' => 'PaymentAccountNumbers' , 'action' => 'list' , 'admin'=>true),
'return_url' => array('plugin' =>'payments' ,'controller' => 'PaymentAccountNumbers' , 'action' => 'mellat_result' , 'admin'=>true),
'terminalId' => '',
'userName' => '',
'userPassword' => '',
)
);
- try_again : this url is your payment page, if something wrong during payment , we get back user to the payment page
- return_url : after user paid correctly the authority key get back to this url
- PIN : this is your pin that you recive from bank - this pin is unique and it set to your ip address that you send to parsian bank
- terminalId : terminalId that banks give to you
- userName : username for this terminal id
- userPassword : password for this terminal id
/**
* admin_mellat_send_to_bank method
*
* @return void
*/
public function admin_mellat_send_to_bank(){
$price = 1000; //Rials
$this->Session->write('amount', $price);
$this->redirect(array('plugin'=>'persian_bank', 'controller' => 'mellat', 'action' => 'bp_pay_request'));
}
/**
* admin_mellat_result method
*
* @return void
*/
public function admin_mellat_result(){
$data = $this->Session->read('data');
$this->Session->delete('data');
// this authority is successfull paid - please attention delete this session(authority) after save your data in database
// save data
}
documentaion that i reciver from parsian bank is placed in Vendor/Documentation/Mellat
- in the PersianBank Plugin Config/bootstrap.php you must add your setting
Configure::write(
'Tejarat',
array(
'try_again' => array('plugin' =>'payments' ,'controller' => 'PaymentAccountNumbers' , 'action' => 'list' , 'admin'=>true),
'return_url' => array('plugin' =>'payments' ,'controller' => 'PaymentAccountNumbers' , 'action' => 'tejarat_result' , 'admin'=>true),
'merchantId' => 'A2A4',
)
);
- try_again : this url is your payment page, if something wrong during payment , we get back user to the payment page
- return_url : after user paid correctly the authority key get back to this url
- merchantId : this is your merchantId that you recive from bank
/**
* admin_mellat_send_to_bank method
*
* @return void
*/
public function admin_tejarat_send_to_bank(){
$price = 1000; //Rials
$this->Session->write('amount', $price);
$this->redirect(array('plugin'=>'persian_bank', 'controller' => 'Tejarat', 'action' => 'send_to_tejarat'));
}
/**
* admin_tejarat_result method
*
* @return void
*/
public function admin_tejarat_result(){
debug($this->request->data);
die();
$data = $this->Session->read('data');
$this->Session->delete('data');
// this authority is successfull paid - please attention delete this session(authority) after save your data in database
// save data
}
documentaion that i reciver from Tejarat bank is placed in Vendor/Documentation/Tejarat