function init()
 {
     $retval = false;
     if (isset($_SESSION['cart_Masterpayment_ID']) && !empty($_SESSION['cart_Masterpayment_ID'])) {
         parent::__construct();
         $this->order_ID = substr($_SESSION['cart_Masterpayment_ID'], strpos($_SESSION['cart_Masterpayment_ID'], '-') + 1);
         $this->notInControlkeyParmeters = array('sex', 'installmentsCount', 'installmentsFreq', 'installmentsPeriod', 'paymentDelay', 'dueDays', 'createAsPending', 'customerNo', 'invoiceNo');
         if ($this->checkRequestAccess()) {
             $this->paymentMethod = $this->getPaymentMethod();
             $retval = true;
         }
     }
     return $retval;
 }
 function masterpayment_config()
 {
     global $order;
     parent::__construct();
     $this->code = 'masterpayment_config';
     $this->title = MODULE_PAYMENT_MASTERPAYMENT_CONFIG_TEXT_TITLE;
     $this->description = MODULE_PAYMENT_MASTERPAYMENT_CONFIG_TEXT_DESCRIPTION;
     $this->enabled = false;
     //BOF - Tomcraft - 2012-12-15 - do not set/show a default sort order, when module is not enabled
     /*
     $this->sort_order		= 10;	  
     */
     $this->sort_order = MODULE_PAYMENT_MASTERPAYMENT_CONFIG_SORT_ORDER;
     //EOF - Tomcraft - 2012-12-15 - do not set/show a default sort order, when module is not enabled
 }
 function __construct(&$_var)
 {
     parent::__construct();
     $this->init($_var);
 }
    $masterpayment = new MasterpaymentRequest();
    if ($masterpayment->init()) {
        $smarty->assign('masterpayment_url', $masterpayment->getMasterpaymentURL());
        $smarty->assign('request_parameters', $masterpayment->generateRequest());
    } else {
        $smarty->assign('masterpayment_error', 1);
    }
    $smarty->assign('masterpayment_button_text', MODULE_PAYMENT_MASTERPAYMENT_FRAME_BUTTON_TEXT);
    $smarty->assign('masterpayment_error_message', MODULE_PAYMENT_MASTERPAYMENT_ERROR_MESSAGE);
    $smarty->assign('masterpayment_error_button_link', $masterpayment->getShopURL() . 'checkout_payment.php?' . session_name() . '=' . session_id());
    $smarty->assign('masterpayment_error_button_text', MODULE_PAYMENT_MASTERPAYMENT_FRAME_ERROR_BUTTON_TEXT);
    $smarty->display(CURRENT_TEMPLATE . '/module/masterpayment_request.html');
    exit;
} else {
    require_once 'includes/masterpayment/MasterpaymentActions.class.php';
    $MasterpaymentActions = new MasterpaymentActions();
    $smarty->assign('language', $_SESSION['language']);
    $smarty->assign('masterpayment_request_url', $MasterpaymentActions->getRequestURL());
    @(include 'lang/' . $_SESSION['language'] . '/modules/payment/masterpayment_config.php');
    if (@file_exists('lang/' . $_SESSION['language'] . '/modules/payment/' . $_SESSION['payment'] . '.php')) {
        include 'lang/' . $_SESSION['language'] . '/modules/payment/' . $_SESSION['payment'] . '.php';
        $smarty->assign('masterpayment_button_text', MODULE_PAYMENT_MASTERPAYMENT_FRAME_BUTTON_TEXT);
        $smarty->assign('masterpayment_payment_title', constant('MODULE_PAYMENT_MASTERPAYMENT_' . strtoupper(str_replace('masterpayment_', '', $_SESSION['payment'])) . '_CHECKOUT_TITLE'));
    }
    // BOF GM_MOD
    if (function_exists('gm_get_conf')) {
        $smarty->assign('LIGHTBOX', gm_get_conf('GM_LIGHTBOX_CHECKOUT'));
        $smarty->assign('LIGHTBOX_CLOSE', xtc_href_link(FILENAME_DEFAULT, '', 'NONSSL'));
    }
    // EOF GM_MOD
    $main_content = $smarty->fetch(CURRENT_TEMPLATE . '/module/checkout_masterpayment.html');