| Server IP : 87.98.231.4 / Your IP : 216.73.217.178 [ Web Server : Apache System : Linux webm007.cluster103.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : grupmartgn ( 667608) PHP Version : 8.5.7 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl Domains : 2 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/grupmartgn/elanartcrafts/plugins/vmuserfield/eway/ |
Upload File : |
<?php
defined('_JEXEC') or die();
/**
*
* Realex User Field plugin
*
* @author Valerie Isaksen
* @version $Id: eway.php 9788 2018-03-12 13:23:51Z alatak $
* @package VirtueMart
* @subpackage userfield
* Copyright (C) 2004 - 2020 Virtuemart Team. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
*
* http://virtuemart.net
*/
if (!class_exists('vmUserfieldPlugin')) {
require(VMPATH_PLUGINLIBS . DS . 'vmuserfieldtypeplugin.php');
}
class plgVmUserfieldEway extends vmUserfieldPlugin {
var $varsToPush = array();
const EWAY_FOLDERNAME = "eway_";
function _construct(& $subject, $config) {
parent::_construct($subject, $config);
$this->_loggable = TRUE;
$this->tableFields = array_keys($this->getTableSQLFields());
$this->_tablepkey = 'id';
$this->_tableId = 'id';
$this->setConfigParameterable('params', $this->varsToPush);
$this->_userFieldName = 'eway_';
}
function plgVmDeclarePluginParamsUserfield($type, $name, $id, &$data) {
return $this->declarePluginParams($type, $name, $id, $data);
}
/**
* Create the table for this plugin if it does not yet exist.
* This functions checks if the called plugin is active one.
* When yes it is calling the standard method to create the tables
*
* @author Valérie Isaksen
*
*/
function plgVmOnStoreInstallPluginTable($type, $data) {
return $this->onStoreInstallPluginTable($type, $data->name);
}
/**
* This method is fired when showing the order details in the frontend.
* It displays the shipment-specific data.
*
* @param integer $order_number The order Number
* @return mixed Null for shipments that aren't active, text (HTML) otherwise
* @author Valérie Isaksen
*/
public function plgVmOnUserfieldDisplay($_prefix, $field, $userId, &$return) {
if ('plugin' . $this->_name != $field->type) {
return;
}
$html = $this->onShowUserDisplayUserfield($userId, $field->name);
if ($html) {
$return['fields'][$field->name]['formcode'] .= $html;
}
return '';
}
function onShowUserDisplayUserfield($userId, $fieldName) {
if ($userId == 0) {
return;
}
$html = '';
if (!class_exists('VmHTML')) {
require(JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php');
}
$view = vRequest::getString('view', '');
$this->loadJLangThis('plg_vmpayment_eway_', 'vmpayment');
if (($view == 'user')) {
$maskedCards = '';
JPluginHelper::importPlugin('vmpayment');
$app = JFactory::getApplication();
$app->triggerEvent('plgVmOnEwayGetCreditCards', array('eway', $userId, &$maskedCards));
$html = $this->renderByLayout("creditcards", array(
"creditCards" => $maskedCards,
));
}
return $html;
}
function deleteCard($userId, $cardToDelete) {
if (!class_exists('VmHTML')) {
require(JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php');
}
$view = vRequest::getString('view', '');
$this->loadJLangThis('plg_vmpayment_eway_', 'vmpayment');
if ($view != 'plugin') {
$result['error'] = true;
$result['msg'] = 'Programming error: View is wrong';
return $result;
}
$maskedCards = '';
$msg = '';
JPluginHelper::importPlugin('vmpayment');
$app = JFactory::getApplication();
$return = $app->triggerEvent('plgVmOnEwayDeleteCreditCard', array('eway', $userId, $cardToDelete, &$maskedCards, &$msg));
$result['error'] = !$return[0];
$result['msg'] = $msg;
$html = $this->renderByLayout("creditcards", array(
"creditCards" => $maskedCards,
"eway_card_selected" => NULL,
"action" => 'delete',
"js" => false,
));
$result['html'] = $html;
return $result;
}
function updateCard($userId, $cardToUpdate) {
if (!class_exists('VmHTML')) {
require(JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php');
}
$view = vRequest::getString('view', '');
$this->loadJLangThis('plg_vmpayment_eway_', 'vmpayment');
if ($view != 'plugin') {
$result['error'] = true;
$result['msg'] = 'Programming error: View is wrong';
return $result;
}
$html = '';
JPluginHelper::importPlugin('vmpayment');
$app = JFactory::getApplication();
$return = $app->triggerEvent('plgVmOnEwayUpdateCreditCard', array('eway', $userId, $cardToUpdate, &$html));
$result['error'] = !$return[0];
$result['html'] = $html;
return $html;
}
function plgVmOnSelfCallFE($type, $name, &$render) {
if ($type != $this->_type) {
return;
}
if ($name != $this->_name) {
return;
}
$token = JSession::getFormToken();
$jinput = JFactory::getApplication()->input;
$call_token = $jinput->get('token', 0, 'ALNUM');
$render['error'] = false;
if ($token != $call_token) {
//$render['error'] = true;
//$render['msg'] = 'Action not allowed (' . __LINE__ . ')';
//return;
}
$user = JFactory::getUser();
if (!$user->id) {
$render['error'] = true;
$render['msg'] = 'Action not allowed (' . __LINE__ . ')';
return;
}
$action = vRequest::getCmd('action');
switch ($action) {
case 'deleteCard':
$cardToDelete = vRequest::getVar('cardToDelete', array());
$render = $this->deleteCard($user->id, $cardToDelete);
echo json_encode($render);
jexit();
break;
case 'updateCard':
$cardToUpdate = vRequest::getVar('cardToUpdate', array());
$render = $this->updateCard($user->id, $cardToUpdate);
break;
default:
$render['error'] = true;
$render['msg'] = 'Action not allowed (' . __LINE__ . ')'.$action;
}
return;
}
}
// No closing tag