<?php
/**
 *      [XCECP] (C) COLNET Inc.
 *      This is NOT a freeware, use is subject to license terms
 */
if(!defined("IN_QKWEB")){exit("Access Denied");}
class PayAction extends BaseAction{
	function index(){
	}
	function payReturn(){
		global $baseUrl;
		$payway = $_GET['PATH_INFO'][2];
		$payfile = ROOT_PATH."plugins/pay/".ucfirst(strtolower($payway)).".class.php";
		if($payway && file_exists($payfile)){
			require_once($payfile);
			$pay = new $payway();
			if($pay->payReturn()){
				header("Location:".$baseUrl."pay/result/status/success");
			}else{
				header("Location:".$baseUrl."pay/result/status/failed");
			}
		}
	}
	function payNotify(){
		global $baseUrl;
		$payway = $_GET['PATH_INFO'][2];
		$payfile = ROOT_PATH."plugins/pay/".ucfirst(strtolower($payway)).".class.php";
		if($payway && file_exists($payfile)){
			require_once($payfile);
			$pay = new $payway();
			$pay->payNotify();
		}else{
			saveLog('支付操作类'.$payway.'不存在：'.$payfile);
		}
	}
	function result(){
		$sm = new SeoModel();
		$pageInfo = $sm->pageInfo(13);
		$pageInfo['title'] = $pageInfo['title']?$pageInfo['title']:$GLOBALS['siteConf']['siteName'];
		assign("pageInfo",$pageInfo);
		display("pay/result");
	}
}
?>