Ejemplo n.º 1
0
 public function index()
 {
     $this->CsdjUser->User_Login();
     $id = (int) $this->uri->segment(4);
     //订单ID
     if ($id == 0) {
         msg_url(L('pay_01'), spacelink('pay'));
     }
     $row = $this->CsdjDB->get_row('pay', '*', $id);
     if (!$row || $row->uid != $_SESSION['cscms__id']) {
         msg_url(L('pay_02'), spacelink('pay'));
     }
     require_once CSCMSPATH . "pay/tenpay/RequestHandler.class.php";
     $partner = CS_Tenpay_ID;
     $key = CS_Tenpay_Key;
     $return_url = site_url('pay/tenpay/return_url');
     $notify_url = site_url('pay/tenpay/notify_url');
     /* 创建支付请求对象 */
     $reqHandler = new RequestHandler();
     $reqHandler->init();
     $reqHandler->setKey($key);
     $reqHandler->setGateUrl("https://gw.tenpay.com/gateway/pay.htm");
     $reqHandler->setParameter("partner", $partner);
     $reqHandler->setParameter("out_trade_no", $row->dingdan);
     $reqHandler->setParameter("total_fee", $row->rmb);
     //总金额
     $reqHandler->setParameter("return_url", $return_url);
     $reqHandler->setParameter("notify_url", $notify_url);
     $reqHandler->setParameter("body", L('pay_03', array($_SESSION['cscms__name'])));
     $reqHandler->setParameter("bank_type", "DEFAULT");
     //银行类型,默认为财付通
     //用户ip
     $reqHandler->setParameter("spbill_create_ip", getip());
     //客户端IP
     $reqHandler->setParameter("fee_type", "1");
     //币种
     $reqHandler->setParameter("subject", L('pay_03', array($_SESSION['cscms__name'])));
     //商品名称
     //系统可选参数
     $reqHandler->setParameter("sign_type", "MD5");
     //签名方式,默认为MD5,可选RSA
     $reqHandler->setParameter("service_version", "1.0");
     //接口版本号
     $reqHandler->setParameter("input_charset", "utf-8");
     //字符集
     $reqHandler->setParameter("sign_key_index", "1");
     //密钥序号
     //业务可选参数
     $reqHandler->setParameter("attach", "");
     //附件数据,原样返回就可以了
     $reqHandler->setParameter("product_fee", "");
     //商品费用
     $reqHandler->setParameter("transport_fee", "0");
     //物流费用
     $reqHandler->setParameter("time_start", date("YmdHis"));
     //订单生成时间
     $reqHandler->setParameter("time_expire", "");
     //订单失效时间
     $reqHandler->setParameter("buyer_id", "");
     //买方财付通帐号
     $reqHandler->setParameter("goods_tag", "");
     //商品标记
     $reqHandler->setParameter("trade_mode", "1");
     //交易模式 1.即时到帐模式,2.中介担保模式,3.后台选择
     $reqHandler->setParameter("transport_desc", "");
     //物流说明
     $reqHandler->setParameter("trans_type", "1");
     //交易类型
     $reqHandler->setParameter("agentid", "");
     //平台ID
     $reqHandler->setParameter("agent_type", "");
     //代理模式(0.无代理,1.表示卡易售模式,2.表示网店模式)
     $reqHandler->setParameter("seller_id", "");
     //卖家的商户号
     //请求的URL
     $reqUrl = $reqHandler->getRequestURL();
     $debugInfo = $reqHandler->getDebugInfo();
     echo '<form action="' . $reqHandler->getGateUrl() . '" name="form1" method="post">';
     $params = $reqHandler->getAllParameters();
     foreach ($params as $k => $v) {
         echo "<input type=\"hidden\" name=\"{$k}\" value=\"{$v}\" />\n";
     }
     echo '<script language="javascript">document.form1.submit();</script></form>';
 }
Ejemplo n.º 2
0
/*
$debugInfo = $reqHandler->getDebugInfo();
echo "<br/>" . $reqUrl . "<br/>";
echo "<br/>" . $debugInfo . "<br/>";
*/
?>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=gbk">
	<title>财付通即时到帐程序演示</title>
</head>
<body>
<br/><a href="<?php 
echo $reqUrl;
?>
" target="_blank">财付通支付</a>
<form action="<?php 
echo $reqHandler->getGateUrl();
?>
" method="post" target="_blank">
<?php 
$params = $reqHandler->getAllParameters();
foreach ($params as $k => $v) {
    echo "<input type=\"hidden\" name=\"{$k}\" value=\"{$v}\" />\n";
}
?>
<input type="submit" value="财付通支付">
</form>
</body>
</html>
Ejemplo n.º 3
0
 public function get_payment_code($payment_notice_id)
 {
     require APP_ROOT_PATH . "system/payment/TenpayBank/classes/RequestHandler.class.php";
     $payment_notice = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment_notice where id = " . $payment_notice_id);
     $order_sn = $GLOBALS['db']->getOne("select order_sn from " . DB_PREFIX . "deal_order where id = " . $payment_notice['order_id']);
     $money = round($payment_notice['money'], 2);
     $payment_info = $GLOBALS['db']->getRow("select id,config,logo from " . DB_PREFIX . "payment where id=" . intval($payment_notice['payment_id']));
     $payment_info['config'] = unserialize($payment_info['config']);
     $data_return_url = SITE_DOMAIN . APP_ROOT . '/callback/payment/tenpayb_response.php';
     $data_notify_url = SITE_DOMAIN . APP_ROOT . '/callback/payment/tenpayb_notify.php';
     $cmd_no = '1';
     /* 获得订单的流水号,补零到10位 */
     $sp_billno = $payment_notice_id;
     $spbill_create_ip = $_SERVER['REMOTE_ADDR'];
     /* 交易日期 */
     $today = to_date($payment_notice['create_time'], 'YmdHis');
     /* 将商户号+年月日+流水号 */
     $out_trade_no = $payment_notice['notice_sn'];
     /* 银行类型:支持纯网关和财付通 */
     $bank_type = intval($GLOBALS['db']->getOne("select bank_id from " . DB_PREFIX . "deal_order where id = " . $payment_notice['order_id']));
     $desc = $out_trade_no;
     $attach = $payment_info['config']['tencentpay_sign'];
     /* 返回的路径 */
     $return_url = $data_return_url;
     /* 总金额 */
     $total_fee = $money * 100;
     /* 货币类型 */
     $fee_type = '1';
     /* 重写自定义签名 */
     //$payment['magic_string'] = abs(crc32($payment['magic_string']));
     /* 数字签名 */
     /* $sign_text = "cmdno=" . $cmd_no . "&date=" . $today . "&bargainor_id=" . $payment_info['config']['tencentpay_id'] .
               "&transaction_id=" . $transaction_id . "&sp_billno=" . $sp_billno .
               "&total_fee=" . $total_fee . "&fee_type=" . $fee_type . "&return_url=" . $return_url .
               "&attach=" . $attach . "&spbill_create_ip=" . $spbill_create_ip ."&key=" . $payment_info['config']['tencentpay_key'];
             $sign = strtoupper(md5($sign_text));
     
              交易参数 
             $parameter = array(
                 'cmdno'             => $cmd_no,                     // 业务代码, 财付通支付支付接口填  1
                 'date'              => $today,                      // 商户日期:如20051212
                 'bank_type'         => $bank_type,                  // 银行类型:支持纯网关和财付通
                 'desc'              => $desc,                       // 交易的商品名称
                 'purchaser_id'      => '',                          // 用户(买方)的财付通帐户,可以为空
                 'bargainor_id'      => $payment_info['config']['tencentpay_id'],  // 商家的财付通商户号
                 'transaction_id'    => $transaction_id,             // 交易号(订单号),由商户网站产生(建议顺序累加)
                 'sp_billno'         => $sp_billno,                  // 商户系统内部的定单号,最多10位
                 'total_fee'         => $total_fee,                  // 订单金额
                 'fee_type'          => $fee_type,                   // 现金支付币种
                 'return_url'        => $return_url,                 // 接收财付通返回结果的URL
                 'attach'            => $attach,                     // 用户自定义签名
             	'spbill_create_ip'  => $spbill_create_ip,           // 安全防范参数
                 'sign'              => $sign,                       // MD5签名
                 //'sys_id'            => '542554970',                 
                 //'sp_suggestuser'    => '1202822001'                 //财付通分配的商户号
             );
     		//
     		
     
     		
     		$payLinks = '<form style="text-align:center;" action="https://www.tenpay.com/cgi-bin/v1.0/pay_gate.cgi" target="_blank" style="margin:0px;padding:0px" >';
     
     	 	foreach ($parameter AS $key=>$val)
             {
                 $payLinks  .= "<input type='hidden' name='$key' value='$val' />";
             }
             
         	if(!empty($payment_info['logo']))
     		{
     			$payLinks .= "<input type='image' src='".APP_ROOT.$payment_info['logo']."' style='border:solid 1px #ccc;'><div class='blank'></div>";
     		}
     		$payLinks .= "<input type='submit' class='paybutton' value='".sprintf($this->payment_lang['GO_TO_PAY'],$this->get_name($bank_type))."'></form>";
             $code = '<div style="text-align:center">'.$payLinks.'</div>';
     		$code.="<br /><div style='text-align:center' class='red'>".$GLOBALS['lang']['PAY_TOTAL_PRICE'].":".format_price($money)."</div>";
             return $code;
             */
     $reqHandler = new RequestHandler();
     $reqHandler->init();
     $reqHandler->setKey($payment_info['config']['tencentpay_key']);
     $reqHandler->setGateUrl("https://gw.tenpay.com/gateway/pay.htm");
     //----------------------------------------
     //设置支付参数
     //----------------------------------------
     $reqHandler->setParameter("partner", $payment_info['config']['tencentpay_id']);
     $reqHandler->setParameter("out_trade_no", $out_trade_no);
     $reqHandler->setParameter("total_fee", $total_fee);
     //总金额
     $reqHandler->setParameter("return_url", $return_url);
     $reqHandler->setParameter("notify_url", $data_notify_url);
     $reqHandler->setParameter("body", $desc);
     $reqHandler->setParameter("bank_type", $bank_type);
     //银行类型,默认为财付通
     //用户ip
     $reqHandler->setParameter("spbill_create_ip", CLIENT_IP);
     //客户端IP
     $reqHandler->setParameter("fee_type", $fee_type);
     //币种
     $reqHandler->setParameter("subject", $desc);
     //商品名称,(中介交易时必填)
     //系统可选参数
     $reqHandler->setParameter("sign_type", "MD5");
     //签名方式,默认为MD5,可选RSA
     $reqHandler->setParameter("service_version", "1.0");
     //接口版本号
     $reqHandler->setParameter("input_charset", "utf-8");
     //字符集
     $reqHandler->setParameter("sign_key_index", "1");
     //密钥序号
     //业务可选参数
     $reqHandler->setParameter("attach", $attach);
     //附件数据,原样返回就可以了
     $reqHandler->setParameter("product_fee", "");
     //商品费用
     $reqHandler->setParameter("transport_fee", "0");
     //物流费用
     $reqHandler->setParameter("time_start", $today);
     //订单生成时间
     $reqHandler->setParameter("time_expire", "");
     //订单失效时间
     $reqHandler->setParameter("buyer_id", "");
     //买方财付通帐号
     $reqHandler->setParameter("goods_tag", "");
     //商品标记
     $reqHandler->setParameter("trade_mode", $cmd_no);
     //交易模式(1.即时到帐模式,2.中介担保模式,3.后台选择(卖家进入支付中心列表选择))
     $reqHandler->setParameter("transport_desc", "");
     //物流说明
     $reqHandler->setParameter("trans_type", "1");
     //交易类型
     $reqHandler->setParameter("agentid", "");
     //平台ID
     $reqHandler->setParameter("agent_type", "");
     //代理模式(0.无代理,1.表示卡易售模式,2.表示网店模式)
     $reqHandler->setParameter("seller_id", "");
     //卖家的商户号
     //请求的URL
     $reqUrl = $reqHandler->getRequestURL();
     /*if($_REQUEST['v']==1){
     			$debugInfo = $reqHandler->getDebugInfo();
     			echo "<br/>" . $reqUrl . "<br/>";
     			echo "<br/>" . $debugInfo . "<br/>";
     			print_r($payment_info['config']);
     		}*/
     $payLinks = '<form style="text-align:center;" action="' . $reqHandler->getGateUrl() . '" target="_blank" style="margin:0px;padding:0px" method="post" >';
     $params = $reqHandler->getAllParameters();
     foreach ($params as $k => $v) {
         $payLinks .= "<input type=\"hidden\" name=\"{$k}\" value=\"{$v}\" />\n";
     }
     $payLinks .= "<button type='submit' class='ui-button paybutton' rel='blue'>" . sprintf($this->payment_lang['GO_TO_PAY'], $this->get_name($bank_type)) . "</button></form>";
     $code = '<div style="text-align:center">' . $payLinks . '</div>';
     $code .= "<br /><div style='text-align:center' class='red'>" . $GLOBALS['lang']['PAY_TOTAL_PRICE'] . ":" . format_price($money) . "</div>";
     return $code;
 }
Ejemplo n.º 4
0
 public function tenpay()
 {
     if ($this->payConfig['tenpay']['enable'] == 0) {
         exit("对不起,该支付方式被关闭,暂时不能使用!");
     }
     $tenpay_params = C('TENPAY_PARAMS');
     $this->getPaydetail();
     $this->paydetail['use_account'] = empty($_GET['useAccount']) ? 0 : $_GET['useAccount'];
     require_once C('APP_ROOT') . "Lib/Pay/Tenpay/RequestHandler.class.php";
     /* 创建支付请求对象 */
     $reqHandler = new RequestHandler();
     $reqHandler->init();
     $reqHandler->setKey($this->payConfig['tenpay']['mkey']);
     $reqHandler->setGateUrl($tenpay_params["PAY_URL"]);
     //----------------------------------------
     //设置支付参数
     //----------------------------------------
     $reqHandler->setParameter("total_fee", doubleval($this->paydetail['money']) * 100);
     //总金额
     //用户ip
     $reqHandler->setParameter("spbill_create_ip", get_client_ip());
     //客户端IP
     $reqHandler->setParameter("return_url", $this->tenpay_rtn_url);
     //支付成功后返回
     $reqHandler->setParameter("partner", $this->payConfig['tenpay']['MerCode']);
     $reqHandler->setParameter("out_trade_no", "tenpay" . date("YmdHis") . rand(10000, 99999));
     $reqHandler->setParameter("notify_url", $this->tenpay_notice_url);
     $reqHandler->setParameter("body", "轩宇泰投资用户充值");
     if ($this->paydetail['use_account'] == 1) {
         $this->paydetail['bank'] = "";
         $reqHandler->setParameter("bank_type", "DEFAULT");
         //买方财付通帐号
     } else {
         $reqHandler->setParameter("bank_type", $this->paydetail['bank']);
         //银行类型,默认为财付通
     }
     $reqHandler->setParameter("fee_type", "1");
     //币种
     //系统可选参数
     $reqHandler->setParameter("sign_type", "MD5");
     //签名方式,默认为MD5,可选RSA
     $reqHandler->setParameter("service_version", "1.0");
     //接口版本号
     $reqHandler->setParameter("input_charset", "UTF-8");
     //字符集
     $reqHandler->setParameter("sign_key_index", "1");
     //密钥序号
     //业务可选参数
     $reqHandler->setParameter("attach", "");
     //附件数据,原样返回就可以了
     $reqHandler->setParameter("product_fee", "");
     //商品费用
     $reqHandler->setParameter("transport_fee", "");
     //物流费用
     $reqHandler->setParameter("time_start", date("YmdHis"));
     //订单生成时间
     $reqHandler->setParameter("time_expire", "");
     //订单失效时间
     $reqHandler->setParameter("buyer_id", "");
     $reqHandler->setParameter("goods_tag", "");
     //商品标记
     //请求的URL
     $reqUrl = $reqHandler->getRequestURL();
     $this->paydetail['fee'] = getfloatvalue($this->payConfig['tenpay']['feerate'] * $this->paydetail['money'] / 100, 2);
     $this->paydetail['nid'] = $this->createnid("tenpay", $reqHandler->getParameter("out_trade_no"));
     $this->paydetail['way'] = "tenpay";
     $this->paydetail['mer_order_num'] = $reqHandler->getParameter("out_trade_no");
     M("member_payonline")->add($this->paydetail);
     $this->create($reqHandler->getAllParameters(), $reqHandler->getGateUrl());
 }
Ejemplo n.º 5
0
$reqHandler->setParameter("agentid", "");
//平台ID
$reqHandler->setParameter("agent_type", "");
//代理模式(0.无代理,1.表示卡易售模式,2.表示网店模式)
$reqHandler->setParameter("seller_id", "");
//卖家的商户号
//请求的URL
$reqUrl = $reqHandler->getRequestURL();
//获取debug信息,建议把请求和debug信息写入日志,方便定位问题
/**/
$debugInfo = $reqHandler->getDebugInfo();
$html = <<<eot
<br/>  {$reqUrl}  <br/>
<br/>  {$debugInfo}  <br/>
<a href="{$reqUrl}" target="_blank">财付通支付</a>
<script>
window.location.href="{$reqUrl}";
</script>
<form action="{$reqHandler->getGateUrl()}" method="post" target="_blank">
eot;
$params = $reqHandler->getAllParameters();
foreach ($params as $k => $v) {
    $html .= "<input type=\"hidden\" name=\"{$k}\" value=\"{$v}\" />\n";
}
$html .= <<<eot
<input type="submit" value="财付通支付">
</form>
eot;
?>

Ejemplo n.º 6
0
    public function dopay($money = null, $order = null, $ordername = null)
    {
        //取插件配置参数
        $conf = F('pluginTenpay');
        if (empty($conf) || APP_DEBUG) {
            $data = M('Addons')->field('param')->where("mark='Tenpay'")->find();
            $conf = json_decode($data['param'], true);
            F('pluginTenpay', $conf);
        }
        define('SHANGHU_ID', $conf['partner']);
        define('SHANGHU_KEY', $conf['key']);
        require_once TENPAY_PATH . "/lib/classes/RequestHandler.class.php";
        require_once TENPAY_PATH . "/lib/tenpay_config.php";
        /* 获取提交的订单号 */
        $out_trade_no = $order;
        /* 获取提交的商品名称 */
        $product_name = $ordername;
        /* 获取提交的商品价格 */
        $order_price = $money;
        /* 获取提交的备注信息 */
        $remarkexplain = '没有备注';
        /* 支付方式  1:即时到帐,2:中介担保,3:后台选择*/
        $trade_mode = 1;
        $strDate = date("Ymd");
        $strTime = date("His");
        /* 商品价格(包含运费),以分为单位 */
        $total_fee = $order_price * 100;
        /* 商品名称 */
        $desc = "商品:" . $product_name . ",备注:" . $remarkexplain;
        /* 创建支付请求对象 */
        $reqHandler = new RequestHandler();
        $reqHandler->init();
        $reqHandler->setKey($key);
        $reqHandler->setGateUrl("https://gw.tenpay.com/gateway/pay.htm");
        //----------------------------------------
        //设置支付参数
        //----------------------------------------
        $reqHandler->setParameter("partner", $partner);
        $reqHandler->setParameter("out_trade_no", $out_trade_no);
        $reqHandler->setParameter("total_fee", $total_fee);
        //总金额
        $reqHandler->setParameter("return_url", $return_url);
        $reqHandler->setParameter("notify_url", $notify_url);
        $reqHandler->setParameter("body", $desc);
        $reqHandler->setParameter("bank_type", "DEFAULT");
        //银行类型,默认为财付通
        //用户ip
        $reqHandler->setParameter("spbill_create_ip", $_SERVER['REMOTE_ADDR']);
        //客户端IP
        $reqHandler->setParameter("fee_type", "1");
        //币种
        $reqHandler->setParameter("subject", $desc);
        //商品名称,(中介交易时必填)
        //系统可选参数
        $reqHandler->setParameter("sign_type", "MD5");
        //签名方式,默认为MD5,可选RSA
        $reqHandler->setParameter("service_version", "1.0");
        //接口版本号
        $reqHandler->setParameter("input_charset", "utf-8");
        //字符集
        $reqHandler->setParameter("sign_key_index", "1");
        //密钥序号
        //业务可选参数
        $reqHandler->setParameter("attach", "");
        //附件数据,原样返回就可以了
        $reqHandler->setParameter("product_fee", "");
        //商品费用
        $reqHandler->setParameter("transport_fee", "0");
        //物流费用
        $reqHandler->setParameter("time_start", date("YmdHis"));
        //订单生成时间
        $reqHandler->setParameter("time_expire", "");
        //订单失效时间
        $reqHandler->setParameter("buyer_id", "");
        //买方财付通帐号
        $reqHandler->setParameter("goods_tag", "");
        //商品标记
        $reqHandler->setParameter("trade_mode", $trade_mode);
        //交易模式(1.即时到帐模式,2.中介担保模式,3.后台选择(卖家进入支付中心列表选择))
        $reqHandler->setParameter("transport_desc", "");
        //物流说明
        $reqHandler->setParameter("trans_type", "1");
        //交易类型
        $reqHandler->setParameter("agentid", "");
        //平台ID
        $reqHandler->setParameter("agent_type", "");
        //代理模式(0.无代理,1.表示卡易售模式,2.表示网店模式)
        $reqHandler->setParameter("seller_id", "");
        //卖家的商户号
        //请求的URL
        $reqUrl = $reqHandler->getRequestURL();
        //获取debug信息,建议把请求和debug信息写入日志,方便定位问题
        /**/
        $debugInfo = $reqHandler->getDebugInfo();
        $html = <<<eot
<form id="tenpay_form" action="{$reqHandler->getGateUrl()}" method="post" target="_blank">
eot;
        $params = $reqHandler->getAllParameters();
        foreach ($params as $k => $v) {
            $html .= "<input type=\"hidden\" name=\"{$k}\" value=\"{$v}\" />\n";
        }
        $html .= <<<eot
<input type="submit" value="财付通支付">
</form>
<script>
document.getElementById('tenpay_form').submit();
</script>
eot;
        return $html;
    }
Ejemplo n.º 7
0
 public function get_payment_code($payment_notice_id)
 {
     require APP_ROOT_PATH . "system/payment/Tenpay/classes/RequestHandler.class.php";
     $payment_notice = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment_notice where id = " . $payment_notice_id);
     $money = round($payment_notice['money'], 2);
     $payment_info = $GLOBALS['db']->getRow("select id,config,logo from " . DB_PREFIX . "payment where id=" . intval($payment_notice['payment_id']));
     $payment_info['config'] = unserialize($payment_info['config']);
     $subject = $payment_notice['deal_name'] == "" ? "充值" . format_price($payment_notice['money']) : $payment_notice['deal_name'];
     $data_return_url = get_domain() . APP_ROOT . '/index.php?ctl=payment&act=response&class_name=Tenpay';
     $data_notify_url = get_domain() . APP_ROOT . '/index.php?ctl=payment&act=notify&class_name=Tenpay';
     $cmd_no = '1';
     /* 获得订单的流水号,补零到10位 */
     $sp_billno = $payment_notice_id;
     $spbill_create_ip = $_SERVER['REMOTE_ADDR'];
     /* 交易日期 */
     $today = to_date($payment_notice['create_time'], 'YmdHis');
     /* 将商户号+年月日+流水号 */
     $out_trade_no = $payment_notice['notice_sn'];
     /* 银行类型:支持纯网关和财付通 */
     $bank_type = '0';
     $desc = $subject;
     $attach = $payment_info['config']['tencentpay_sign'];
     /* 返回的路径 */
     $return_url = $data_return_url;
     /* 总金额 */
     $total_fee = $money * 100;
     /* 货币类型 */
     $fee_type = '1';
     /* 重写自定义签名 */
     //$payment['magic_string'] = abs(crc32($payment['magic_string']));
     /* 数字签名 */
     /*$sign_text = "cmdno=" . $cmd_no . "&date=" . $today . "&bargainor_id=" . $payment_info['config']['tencentpay_id'] .
         "&transaction_id=" . $transaction_id . "&sp_billno=" . $sp_billno .
         "&total_fee=" . $total_fee . "&fee_type=" . $fee_type . "&return_url=" . $return_url .
         "&attach=" . $attach . "&spbill_create_ip=" . $spbill_create_ip ."&key=" . $payment_info['config']['tencentpay_key'];
       $sign = strtoupper(md5($sign_text));*/
     $reqHandler = new RequestHandler();
     $reqHandler->init();
     $reqHandler->setKey($payment_info['config']['tencentpay_key']);
     $reqHandler->setGateUrl("https://gw.tenpay.com/gateway/pay.htm");
     //----------------------------------------
     //设置支付参数
     //----------------------------------------
     $reqHandler->setParameter("partner", $payment_info['config']['tencentpay_id']);
     $reqHandler->setParameter("out_trade_no", $out_trade_no);
     $reqHandler->setParameter("total_fee", $total_fee);
     //总金额
     $reqHandler->setParameter("return_url", $return_url);
     $reqHandler->setParameter("notify_url", $data_notify_url);
     $reqHandler->setParameter("body", $desc);
     $reqHandler->setParameter("bank_type", $bank_type);
     //银行类型,默认为财付通
     //用户ip
     $reqHandler->setParameter("spbill_create_ip", get_client_ip());
     //客户端IP
     $reqHandler->setParameter("fee_type", $fee_type);
     //币种
     $reqHandler->setParameter("subject", $desc);
     //商品名称,(中介交易时必填)
     //系统可选参数
     $reqHandler->setParameter("sign_type", "MD5");
     //签名方式,默认为MD5,可选RSA
     $reqHandler->setParameter("service_version", "1.0");
     //接口版本号
     $reqHandler->setParameter("input_charset", "utf-8");
     //字符集
     $reqHandler->setParameter("sign_key_index", "1");
     //密钥序号
     //业务可选参数
     $reqHandler->setParameter("attach", $attach);
     //附件数据,原样返回就可以了
     $reqHandler->setParameter("product_fee", "");
     //商品费用
     $reqHandler->setParameter("transport_fee", "0");
     //物流费用
     $reqHandler->setParameter("time_start", $today);
     //订单生成时间
     $reqHandler->setParameter("time_expire", "");
     //订单失效时间
     $reqHandler->setParameter("buyer_id", "");
     //买方财付通帐号
     $reqHandler->setParameter("goods_tag", "");
     //商品标记
     $reqHandler->setParameter("trade_mode", $cmd_no);
     //交易模式(1.即时到帐模式,2.中介担保模式,3.后台选择(卖家进入支付中心列表选择))
     $reqHandler->setParameter("transport_desc", "");
     //物流说明
     $reqHandler->setParameter("trans_type", "1");
     //交易类型
     $reqHandler->setParameter("agentid", "");
     //平台ID
     $reqHandler->setParameter("agent_type", "");
     //代理模式(0.无代理,1.表示卡易售模式,2.表示网店模式)
     $reqHandler->setParameter("seller_id", "");
     //卖家的商户号
     //请求的URL
     $reqUrl = $reqHandler->getRequestURL();
     if ($_REQUEST['v'] == 1) {
         $debugInfo = $reqHandler->getDebugInfo();
         echo "<br/>" . $reqUrl . "<br/>";
         echo "<br/>" . $debugInfo . "<br/>";
     }
     $payLinks = '<form style="text-align:center;" id="jumplink" action="' . $reqHandler->getGateUrl() . '" target="_self" style="margin:0px;padding:0px" method="post" >';
     $params = $reqHandler->getAllParameters();
     foreach ($params as $k => $v) {
         $payLinks .= "<input type=\"hidden\" name=\"{$k}\" value=\"{$v}\" />\n";
     }
     $payLinks .= "正在连接支付接口...</form>";
     $payLinks .= '<script type="text/javascript">document.getElementById("jumplink").submit();</script>';
     return $payLinks;
 }