[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path Zen Cart 源代码 payment.php
<?php
/**
* Payment Class.
*
* @package classes
* @copyright Copyright 2003-2014 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version GIT: $Id: Author: Ian Wilson Modified in v1.5.4 $
*/
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
/**
* Payment Class.
* This class interfaces with various payment modules
*
* @package classes
*/
class payment extends base {
var $modules, $selected_module, $doesCollectsCardDataOnsite;
// class constructor
function payment($module = '') {
global $PHP_SELF, $language, $credit_covers, $messageStack;
$this->doesCollectsCardDataOnsite = false;
if (defined('MODULE_PAYMENT_INSTALLED') && zen_not_null(MODULE_PAYMENT_INSTALLED)) {
$this->modules = explode(';', MODULE_PAYMENT_INSTALLED);
$this->paymentClass = new $include_modules[$i]['class'];
$this->notify('NOTIFY_PAYMENT_MODULE_ENABLE');
if ($this->paymentClass->enabled)
{
$GLOBALS[$include_modules[$i]['class']] = $this->paymentClass;
if (isset($this->paymentClass->collectsCardDataOnsite) && $this->paymentClass->collectsCardDataOnsite == true) {
$this->doesCollectsCardDataOnsite = true;
}
} else {
unset($include_modules[$i]);
}
}
$include_modules = array_values($include_modules);
// 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 (!isset($credit_covers) || $credit_covers == FALSE) $_SESSION['payment'] = $include_modules[0]['class'];
}
// class methods
/* The following method is needed in the checkout_confirmation.php page
due to a chicken and egg problem with the payment class and order class.
The payment modules needs the order destination data for the dynamic status
feature, and the order class needs the payment module title.
The following method is a work-around to implementing the method in all
payment modules available which would break the modules in the contributions
section. This should be looked into again post 2.2.
*/
function update_status() {
if (is_array($this->modules)) {
if (is_object($GLOBALS[$this->selected_module])) {
if (method_exists($GLOBALS[$this->selected_module], 'update_status')) {
$GLOBALS[$this->selected_module]->update_status();
}
}
}
}