<?php
require_once("alipay.config.php");
require_once("lib/alipay_submit.class.php");
/**************************请求参数**************************/

        
        $payment_type = "1";//支付类型
        $notify_url = "http://".$_SERVER['HTTP_HOST'].cd_webpath."plug/alipay/vip_years_return.php";//服务器异步通知页面路径
		$return_url = "http://".$_SERVER['HTTP_HOST'].cd_webpath."plug/alipay/notify.php";//页面跳转同步通知页面路径
        $seller_email = trim(cd_xalipayuser);//收款帐号
        $out_trade_no = trim($cd_key); //唯一订单号
        $subject=$name; //订单名称
        $price=trim($points); //付款金额
        $quantity="1"; //商品数量
        $logistics_fee="0.00"; //物流费用
        $logistics_type="EXPRESS"; //物流类型
        $logistics_payment="SELLER_PAY"; //物流支付方式
        $body=$name; //订单描述
        $show_url="http://" . cd_weburl; //商品展示地址
        $receive_name=$CcTvAi_com_nicheng; //收货人姓名
        $receive_address=$CcTvAi_com_username; //收货人地址
        $receive_zip=""; //收货人邮编
        $receive_phone=""; //收货人电话号码
        $receive_mobile=""; //收货人手机号码

/************************************************************/

//构造要请求的参数数组，无需改动
$parameter = array(
		"service" => "trade_create_by_buyer",
		"partner" => trim($alipay_config['partner']),
		"payment_type"	=> $payment_type,
		"notify_url"	=> $notify_url,
		"return_url"	=> $return_url,
		"seller_email"	=> $seller_email,
		"out_trade_no"	=> $out_trade_no,
		"subject"	=> $subject,
		"price"	=> $price,
		"quantity"	=> $quantity,
		"logistics_fee"	=> $logistics_fee,
		"logistics_type"	=> $logistics_type,
		"logistics_payment"	=> $logistics_payment,
		"body"	=> $body,
		"show_url"	=> $show_url,
		"receive_name"	=> $receive_name,
		"receive_address"	=> $receive_address,
		"receive_zip"	=> $receive_zip,
		"receive_phone"	=> $receive_phone,
		"receive_mobile"	=> $receive_mobile,
		"_input_charset"	=> trim(strtolower($alipay_config['input_charset']))
);
//建立请求
$alipaySubmit = new AlipaySubmit($alipay_config);
$html_text = $alipaySubmit->buildRequestForm($parameter,"get", "正在载入中...");
echo $html_text;
?>