function onPaymentConfigurationSave(&$element) { parent::onPaymentConfigurationSave($element); $secret = $element->payment_params->secret_code; if (empty($element->payment_id)) { $pluginClass = hikashop_get('class.payment'); $status = $pluginClass->save($element); if (!$status) { return true; } $element->payment_id = $status; } jimport('joomla.filesystem.file'); $lang = JFactory::getLanguage(); $locale = strtolower(substr($lang->get('tag'), 0, 2)); $opts = array('option' => 'com_hikashop', 'tmpl' => 'component', 'ctrl' => 'checkout', 'task' => 'notify', 'notif_payment' => $this->name, 'format' => 'html', 'local' => $locale, 'notif_id' => $element->payment_id, 'from_user' => 'return'); $content = '<?php' . "\r\n"; foreach ($opts as $k => $v) { $v = str_replace(array('\'', '\\'), '', $v); $content .= '$_GET[\'' . $k . '\']=\'' . $v . '\';' . "\r\n" . '$_REQUEST[\'' . $k . '\']=\'' . $v . '\';' . "\r\n"; } $content .= 'include(\'index.php\');' . "\r\n"; JFile::write(JPATH_ROOT . DS . $this->name . '_return_' . $element->payment_id . '.php', $content); $opts['from_user'] = '******'; $content = '<?php' . "\r\n"; foreach ($opts as $k => $v) { $v = str_replace(array('\'', '\\'), '', $v); $content .= '$_GET[\'' . $k . '\']=\'' . $v . '\';' . "\r\n" . '$_REQUEST[\'' . $k . '\']=\'' . $v . '\';' . "\r\n"; } $content .= 'include(\'index.php\');' . "\r\n"; JFile::write(JPATH_ROOT . DS . $this->name . '_cancel_' . $element->payment_id . '.php', $content); unset($opts['from_user']); $opts['secret_code'] = $secret; $content = '<?php' . "\r\n"; foreach ($opts as $k => $v) { $v = str_replace(array('\'', '\\'), '', $v); $content .= '$_GET[\'' . $k . '\']=\'' . $v . '\';' . "\r\n" . '$_REQUEST[\'' . $k . '\']=\'' . $v . '\';' . "\r\n"; } $content .= 'include(\'index.php\');' . "\r\n"; JFile::write(JPATH_ROOT . DS . $this->name . '_' . $element->payment_id . '_' . $secret . '.php', $content); return true; }
function onPaymentConfigurationSave(&$element) { parent::onPaymentConfigurationSave($element); if (empty($element->payment_id)) { $pluginClass = hikashop_get('class.payment'); $status = $pluginClass->save($element); if (!$status) { return true; } $element->payment_id = $status; } $app = JFactory::getApplication(); jimport('joomla.filesystem.file'); jimport('joomla.filesystem.path'); $lang = JFactory::getLanguage(); $locale = strtolower(substr($lang->get('tag'), 0, 2)); $content = '<?php $_GET[\'option\']=\'com_hikashop\'; $_GET[\'tmpl\']=\'component\'; $_GET[\'ctrl\']=\'checkout\'; $_GET[\'task\']=\'notify\'; $_GET[\'notif_payment\']=\'paybox\'; $_GET[\'format\']=\'html\'; $_GET[\'lang\']=\'' . $locale . '\'; $_GET[\'notif_id\']=\'' . $element->payment_id . '\'; $_REQUEST[\'option\']=\'com_hikashop\'; $_REQUEST[\'tmpl\']=\'component\'; $_REQUEST[\'ctrl\']=\'checkout\'; $_REQUEST[\'task\']=\'notify\'; $_REQUEST[\'notif_payment\']=\'paybox\'; $_REQUEST[\'format\']=\'html\'; $_REQUEST[\'lang\']=\'' . $locale . '\'; $_REQUEST[\'notif_id\']=\'' . $element->payment_id . '\'; include(\'index.php\'); '; JFile::write(JPATH_ROOT . DS . 'paybox_' . $element->payment_id . '.php', $content); return true; }
public function onPaymentConfigurationSave(&$element) { $ret = parent::onPaymentConfigurationSave($element); $this->generateRootFile($element); return $ret; }
/** * */ public function onPaymentConfigurationSave(&$element) { $ret = parent::onPaymentConfigurationSave($element); if (empty($element->payment_params->currency)) { $element->payment_params->currency = 'AUD'; } jimport('joomla.filesystem.file'); $lang = JFactory::getLanguage(); $locale = strtolower(substr($lang->get('tag'), 0, 2)); $opts = array('option' => 'com_hikashop', 'tmpl' => 'component', 'ctrl' => 'checkout', 'task' => 'notify', 'notif_payment' => $this->name, 'format' => 'html', 'local' => $locale, 'notif_id' => $element->payment_id); $content = '<?php' . "\r\n"; foreach ($opts as $k => $v) { $v = str_replace(array('\'', '\\'), '', $v); $content .= '$_GET[\'' . $k . '\']=\'' . $v . '\';' . "\r\n" . '$_REQUEST[\'' . $k . '\']=\'' . $v . '\';' . "\r\n"; } $content .= 'include(\'index.php\');' . "\r\n"; JFile::write(JPATH_ROOT . DS . $this->name . '_' . $element->payment_id . '.php', $content); return $ret; }
function onPaymentConfigurationSave(&$element) { parent::onPaymentConfigurationSave($element); $app = JFactory::getApplication(); jimport('joomla.filesystem.file'); jimport('joomla.filesystem.path'); $lang = JFactory::getLanguage(); $locale = strtolower(substr($lang->get('tag'), 0, 2)); $writen = true; $content = '<?php $_GET[\'option\']=\'com_hikashop\'; $_GET[\'tmpl\']=\'component\'; $_GET[\'ctrl\']=\'checkout\'; $_GET[\'task\']=\'notify\'; $_GET[\'notif_payment\']=\'beanstream\'; $_GET[\'format\']=\'html\'; $_GET[\'lang\']=\'' . $locale . '\'; $_REQUEST[\'option\']=\'com_hikashop\'; $_REQUEST[\'tmpl\']=\'component\'; $_REQUEST[\'ctrl\']=\'checkout\'; $_REQUEST[\'task\']=\'notify\'; $_REQUEST[\'notif_payment\']=\'beanstream\'; $_REQUEST[\'format\']=\'html\'; $_REQUEST[\'lang\']=\'' . $locale . '\'; include(\'index.php\'); '; ob_start(); $writen = JFile::write(JPATH_ROOT . DS . 'beanstream_params.php', $content); ob_get_clean(); if (!$writen) { $app->enqueueMessage('The plugin failed writing the file beanstream_params.php in the root directory : ' . JPATH_ROOT . DS . '. Please check if the writing permission has been given to the owner.', 'error'); } $content = '<?php $_GET[\'option\']=\'com_hikashop\'; $_GET[\'tmpl\']=\'component\'; $_GET[\'ctrl\']=\'checkout\'; $_GET[\'task\']=\'notify\'; $_GET[\'notif_payment\']=\'beanstream\'; $_GET[\'format\']=\'html\'; $_GET[\'lang\']=\'' . $locale . '\'; $_GET[\'userside\']=\'1\'; $_REQUEST[\'option\']=\'com_hikashop\'; $_REQUEST[\'tmpl\']=\'component\'; $_REQUEST[\'ctrl\']=\'checkout\'; $_REQUEST[\'task\']=\'notify\'; $_REQUEST[\'notif_payment\']=\'beanstream\'; $_REQUEST[\'format\']=\'html\'; $_REQUEST[\'lang\']=\'' . $locale . '\'; $_REQUEST[\'userside\']=\'1\'; include(\'index.php\'); '; ob_start(); $writen = JFile::write(JPATH_ROOT . DS . 'beanstream_params_u.php', $content); ob_get_clean(); if (!$writen) { $app->enqueueMessage('The plugin failed writing the file beanstream_params_u.php in the root directory : ' . JPATH_ROOT . DS . '. Please check if the writing permission has been given to the owner.', 'error'); } return true; }