<?php

/*

  osCommRes, Services Online
  http://www.oscommres.com

  Copyright (c) 2005 osCommRes

  Released under the GNU General Public License
  
  Freeway eCommerce from ZacWare
http://www.zac-ware.com/freeway

Copyright 2007 ZacWare Pty. Ltd
*/
// Set flag that this is a parent file
	define( '_FEXEC', 1 );
    require('includes/application_top.php');
	
	$cID=(isset($HTTP_SESSION_VARS['upload_id'])?(int)$HTTP_SESSION_VARS['upload_id']:0);
	$checkID=(isset($HTTP_SESSION_VARS["checkID"])?$HTTP_SESSION_VARS["checkID"]:'');
	$payment_page=(isset($HTTP_SESSION_VARS["payment_page"])?$HTTP_SESSION_VARS["payment_page"]:'');
	$error_text=(isset($HTTP_POST_VARS["err"])?$HTTP_POST_VARS["err"]:'');
	
	switch($payment_page){
		case "wallet":
			if($error_text=="") { //approved transaction
				tep_redirect(tep_href_link(FILENAME_WALLET_PROCESS, 'validID=' . $checkID, 'SSL'));
			}else{
				tep_redirect(tep_href_link(FILENAME_WALLET_PAYMENT, 'payment_error=virtualpay&error=' . urlencode($error_text), 'SSL'));
			}
		default:
			if($error_text=="") { //approved transaction
					tep_redirect(tep_href_link(FILENAME_CHECKOUT_PROCESS, '' , 'SSL'));
			}else{
				tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=virtualpay&error=' . urlencode($error_text), 'SSL'));
			}
	}
?>