Beispiel #1
0
<?php

/**
 * @version $Id: processor_list.php
 * @package AEC - Account Control Expiration - Membership Manager
 * @subpackage Main Frontend
 * @copyright 2012 Copyright (C) David Deutsch
 * @author David Deutsch <*****@*****.**> & Team AEC - http://www.valanx.org
 * @license GNU/GPL v.3 http://www.gnu.org/licenses/gpl.html or, at your option, any later version
 */
// Dont allow direct linking
defined('_JEXEC') or die('Direct Access to this location is not allowed.');
$processors = array();
if (!empty($tmpl->cfg['gwlist'])) {
    $gwnames = PaymentProcessorHandler::getInstalledNameList(true);
    if (!empty($gwnames)) {
        foreach ($gwnames as $procname) {
            if (!in_array($procname, $tmpl->cfg['gwlist'])) {
                continue;
            }
            $processor = trim($procname);
            $processors[$processor] = new PaymentProcessor();
            if ($processors[$processor]->loadName($processor)) {
                $processors[$processor]->init();
                $processors[$processor]->getInfo();
                $processors[$processor]->getSettings();
            } else {
                unset($processors[$processor]);
            }
        }
    }
Beispiel #2
0
 public function touchProcessors()
 {
     // Make sure settings & info are updated
     $pplist = PaymentProcessorHandler::getInstalledNameList();
     foreach ($pplist as $ppname) {
         $pp = new PaymentProcessor();
         if (!$pp->loadName($ppname)) {
             continue;
         }
         $pp->copyAssets();
         $pp->fullInit();
         // Infos often change, so we protect the name and description and so on, but replace everything else
         $original = $pp->processor->info();
         $protect = array('name', 'longname', 'statement', 'description');
         foreach ($original as $name => $var) {
             if (!in_array($name, $protect)) {
                 $pp->info[$name] = $var;
             }
         }
         $pp->processor->storeload();
     }
 }
Beispiel #3
0
 public function readProcessors()
 {
     $lang = JFactory::getLanguage();
     $readout = array();
     $r = array();
     $r['head'] = "Processors";
     $processors = PaymentProcessorHandler::getInstalledNameList();
     foreach ($processors as $procname) {
         $pp = null;
         $pp = new PaymentProcessor();
         if (!$pp->loadName($procname)) {
             continue;
         }
         $pp->fullInit();
         $readout[] = $r;
         $r = array();
         $r['head'] = $pp->info['longname'];
         $r['type'] = "table";
         $r['sub'] = true;
         $r['def'] = array("ID" => array('id'), "Published" => array('active', 'bool'));
         foreach ($pp->info as $iname => $ic) {
             if (empty($iname)) {
                 continue;
             }
             $cname = 'CFG_' . strtoupper($procname) . '_' . strtoupper($iname) . '_NAME';
             $gname = 'CFG_PROCESSOR_' . strtoupper($iname) . '_NAME';
             if ($lang->hasKey($cname)) {
                 $tname = JText::_($cname);
             } elseif ($lang->hasKey($gname)) {
                 $tname = JText::_($gname);
             } else {
                 $tname = $iname;
             }
             $r['def'][$tname] = array(array('info', $iname), 'smartlimit');
         }
         $bsettings = $pp->getBackendSettings();
         foreach ($bsettings as $psname => $sc) {
             if (empty($psname) || is_numeric($psname) || $psname == 'lists') {
                 continue;
             }
             $cname = 'CFG_' . strtoupper($procname) . '_' . strtoupper($psname) . '_NAME';
             $gname = 'CFG_PROCESSOR_' . strtoupper($psname) . '_NAME';
             if ($lang->hasKey($cname)) {
                 $tname = JText::_($cname);
             } elseif ($lang->hasKey($gname)) {
                 $tname = JText::_($gname);
             } else {
                 $tname = $psname;
             }
             if ($sc[0] == 'list_yesno') {
                 $stype = 'bool';
             } else {
                 $stype = 'smartlimit';
             }
             $r['def'][$tname] = array(array('settings', $psname), $stype);
         }
         $ps = array();
         foreach ($r['def'] as $nn => $def) {
             $ps = array_merge($ps, $this->conversionHelper($def, $pp));
         }
         $r['set'] = array(0 => $ps);
     }
     $readout[] = $r;
     return $readout;
 }