Only authorizenet_aim is enabled and set green everything else is red. Also ran this mysql query.
SELECT *
FROM configuration
WHERE configuration_key LIKE '%MODULE_PAYMENT_INSTALLED%'
which returned...
configuration_id configuration_title configuration_key configuration_value configuration_description
148 Installed Modules MODULE_PAYMENT_INSTALLED authorizenet_aim.php List of payment module filenames separated by a se...
I need to correct the last post. There is an if then statment for the before_process function. It is in the payment.php class
function before_process() {
if (is_array($this->modules)) {
if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->enabled) ) {
return $GLOBALS[$this->selected_module]->before_process();
}
}
}
This is run right before it calls the before_process function in authorizenet_aim.php. Maybe I should manually set the payment module in checkout_process.php when it calls the payment class...see below...
$payment_modules = new payment($_SESSION['payment']);
to
$payment_modules = new payment('authorizenet_aim']);
That would address your hunch that another module is set. After the payment class is called it runs a class constructor that sets the $this->modules and $this->selected_module which is what is checked when before_process function is called. I don't know but my gut tells me this is where the trouble starts. See the class constructor code below... It talks about freecharger.php but I don't know what that is?????.... Maybe the $_SESSION[payment] is getting lost or something. Changing the code above would address that too
// class constructor
function payment($module = '') {
global $PHP_SELF, $language, $credit_covers, $messageStack;
if (defined('MODULE_PAYMENT_INSTALLED') && zen_not_null(MODULE_PAYMENT_INSTALLED)) {
$this->modules = explode(';', MODULE_PAYMENT_INSTALLED);
$include_modules = array();
if ( (zen_not_null($module)) && (in_array($module . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)), $this->modules)) ) {
$this->selected_module = $module;
$include_modules[] = array('class' => $module, 'file' => $module . '.php');
} else {
reset($this->modules);
// Free Payment Only shows
if (zen_get_configuration_key_value('MODULE_PAYMENT_FREECHARGER_STATUS') and ($_SESSION['cart']->show_total()==0 and $_SESSION['shipping']['cost']== 0)) {
$this->selected_module = $module;
if (file_exists(DIR_FS_CATALOG . DIR_WS_MODULES . '/payment/' . 'freecharger.php')) {
$include_modules[] = array('class'=> 'freecharger', 'file' => 'freecharger.php');
}
} else {
// All Other Payment Modules show
while (list(, $value) = each($this->modules)) {
// double check that the module really exists before adding to the array
if (file_exists(DIR_FS_CATALOG . DIR_WS_MODULES . '/payment/' . $value)) {
$class = substr($value, 0, strrpos($value, '.'));
// Don't show Free Payment Module
if ($class !='freecharger') {
$include_modules[] = array('class' => $class, 'file' => $value);
}
}
}
}
}
for ($i=0, $n=sizeof($include_modules); $i<$n; $i++) {
// include(DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/payment/' . $include_modules[$i]['file']);
$lang_file = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/payment/', $include_modules[$i]['file'], 'false');
if (@file_exists($lang_file)) {
include_once($lang_file);
} else {
if (IS_ADMIN_FLAG === false) {
$messageStack->add(WARNING_COULD_NOT_LOCATE_LANG_FILE . $lang_file, 'caution');
} else {
$messageStack->add_session(WARNING_COULD_NOT_LOCATE_LANG_FILE . $lang_file, 'caution');
}
}
include_once(DIR_WS_MODULES . 'payment/' . $include_modules[$i]['file']);
$GLOBALS[$include_modules[$i]['class']] = new $include_modules[$i]['class'];
}
// if there is only one payment method, select it as default because in
// checkout_confirmation.php the $payment variable is being assigned the
// $_POST['payment'] value which will be empty (no radio button selection possible)
if ( (zen_count_payment_modules() == 1) && (!isset($_SESSION['payment']) || (isset($_SESSION['payment']) && !is_object($_SESSION['payment']))) ) {
if (!$credit_covers) $_SESSION['payment'] = $include_modules[0]['class'];
}
if ( (zen_not_null($module)) && (in_array($module, $this->modules)) && (isset($GLOBALS[$module]->form_action_url)) ) {
$this->form_action_url = $GLOBALS[$module]->form_action_url;
}
}
}