<?php
/*
	osCommRes, Services Oline 
	http://www.oscommres.com 
	Copyright (c) 2005 osCommRes 
	
	Freeway eCommerce 
	http://www.zac-ware.com/freeway 
	Copyright (c) 2007 ZacWare
	
	Released under the GNU General Public License
*/


// Set flag that this is a parent file
	define( '_FEXEC', 1 );
	
  require('includes/application_top.php');
	// if the customer is not logged on, redirect them to the login page
	if (!tep_session_is_registered('customer_id')) {
		$navigation->set_snapshot();
		tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
	}

	if (!tep_session_is_registered('payment_page')){
		tep_session_register('payment_page');
		$payment_page="wallet";
	}

	// check for payment already exits
	
	if (tep_session_is_registered('payment') && $payment=="wallet"){
		tep_session_unregister("payment");
	}
	if (!tep_session_is_registered('billto')) {
		tep_session_register('billto');
	}
	$billto=$customer_default_address_id;
	if (!tep_session_is_registered('wallet_timestamp')) tep_session_register('wallet_timestamp');	
	// load all enabled payment modules
	require(DIR_WS_CLASSES . 'payment.php');
	$payment_modules = new payment;
	//$payment_modules->update_status();
	
	require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_WALLET_CHECKOUT_PAYMENT);
	$breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_WALLET_CHECKOUT_PAYMENT, '', 'SSL'));

	
	$content = CONTENT_WALLET_CHECKOUT_PAYMENT;
	$javascript= $content . '.js.php';
	
	require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
	require(DIR_WS_INCLUDES . 'application_bottom.php');
?>