<?php
define('DIRCMS_ROOT', str_replace("\\", '/',substr(dirname(__FILE__),0,-6)));
include DIRCMS_ROOT.'include/common.inc.php';
include DIRCMS_ROOT.'member/include/global.func.php';

$pay_code = trim($code);
if(empty($pay_code) || !in_array($pay_code,array('alipay','bank','chinabank','post','tenpay')))
{
	showmsg('不被支持的支付方式!');
}
else
{
	$plugin_file = DIRCMS_ROOT.'api/'.$pay_code.'.php';
	if(is_file($plugin_file))
	{
		include_once( $plugin_file );
		$payment = new $pay_code();
		$result = $payment->respond();
		if ($result)
		{
           showmsg('支付成功！',$DIRCMS['site_url'].'member/index.php?file=account&action=paylog');
		}
		else if($payment->err)
		{
			showmsg_nourl($payment->err);
		}
		else
		{
			showmsg('支付失败！');
		}
	}
	else
	{
		showmsg("不被支持的支付方式!");
	}
}
?>
