name = 'atos_cyberplus';
$this->tab = 'payments_gateways';
$this->version = 1.0;
/* The parent construct is required for translations */
parent::__construct();
$this->page = basename(__FILE__, '.php');
$this->displayName = $this->l('Atos');
$this->description = $this->l('This payment module for banks using ATOS allows your customers to pay by Credit Card');
}
public function install()
{
Configuration::updateValue('ATOS_MERCHANT_ID', '038862749811111');
parent::install();
$this->registerHook('payment');
}
public function uninstall()
{
Configuration::deleteByName('ATOS_MERCHANT_ID');
parent::uninstall();
}
public function _displayForm()
{
if (!isset($_POST['submit']))
$_POST['merchant_id'] = Configuration::get('ATOS_MERCHANT_ID');
$this->_html .=
'
';
}
private function _postProcess()
{
Configuration::updateValue('ATOS_MERCHANT_ID', $_POST['merchant_id']);
}
private function _postValidation()
{
if(!isset($_POST['merchant_id']) OR empty($_POST['merchant_id']))
$this->_postErrors[] = 'You must enter a merchant ID.';
elseif (!is_numeric($_POST['merchant_id']))
$this->_postErrors[] = 'Your merchant ID is not valid.';
}
function getContent()
{
$this->_html .= '
'.$this->displayName.'
';
if (!empty($_POST))
{
$this->_postValidation();
if (!count($this->_postErrors))
$this->_postProcess();
else
foreach ($this->_postErrors AS $err)
$this->_html .= '