buildRequestMysign() public method

生成签名结果
public buildRequestMysign ( $para_sort )
$para_sort 已排序要签名的数组 return 签名结果字符串
 public function doalipayWap()
 {
     //echo "<pre>";var_dump( $_SERVER );echo "</pre>";
     //返回格式
     $format = "xml";
     //必填,不需要修改//返回格式
     $v = "2.0";
     //这里我们通过TP的C函数把配置项参数读出,赋给$alipay_config;
     $alipay_config = C('alipay_config');
     /**************************请求参数**************************/
     $payment_type = C('alipay_config.sign_type');
     //支付类型 //必填,不能修改
     $notify_url = C('alipay.notify_urlWap');
     //服务器异步通知页面路径
     $return_url = C('alipay.return_urlWap');
     //页面跳转同步通知页面路径
     $merchant_url = C('alipay.merchant_urlWap');
     //操作中断返回地址
     $seller_email = C('alipay.seller_email');
     //卖家支付宝帐户必填
     $out_trade_no = $_POST['trade_no'];
     //商户订单号 通过支付页面的表单进行传递,注意要唯一!
     $subject = $_POST['ordsubject'];
     //订单名称 //必填 通过支付页面的表单进行传递
     $total_fee = $_POST['ordtotal_fee'];
     //付款金额  //必填 通过支付页面的表单进行传递
     $body = $_POST['ordbody'];
     //订单描述 通过支付页面的表单进行传递
     $show_url = $_POST['ordshow_url'];
     //商品展示地址 通过支付页面的表单进行传递
     $anti_phishing_key = "";
     //防钓鱼时间戳 //若要使用请调用类文件submit中的query_timestamp函数
     //$exter_invoke_ip = get_client_ip();//var_dump($exter_invoke_ip);die();   //客户端的IP地址
     $exter_invoke_ip = $_SERVER["REMOTE_ADDR"];
     //var_dump($exter_invoke_ip);die();   //客户端的IP地址
     /************************************************************/
     //对前台传过来的价钱数据做判断
     $orderId = $out_trade_no;
     $oOb = M("order");
     $orderArr = $oOb->field("count(*) as num")->where("orderId='{$orderId}'")->select();
     $num = $orderArr[0]['num'];
     if ($num == 0) {
         $coOb = M("cardorder");
         $arr = $coOb->where("orderId='{$orderId}'")->select();
         //var_dump($arr);
         $realPrice = $arr[0]['price'] - $arr[0]['discount'] - $arr[0]['yhqPrice'];
         //var_dump($total_fee); var_dump($realPrice); die;
         if ($total_fee != $realPrice) {
             header("location:index.php?m=Member&a=payFail");
         }
     } else {
         $arr = $oOb->where("orderId='{$orderId}'")->select();
         $realPrice = $arr[0]['price'] - $arr[0]['discount'] - $arr[0]['yhq'];
         if ($total_fee != $realPrice) {
             header("location:index.php?m=Member&a=payFail");
         }
     }
     $call_back_url = $return_url;
     //请求业务参数详细
     $req_data = '<direct_trade_create_req><notify_url>' . $notify_url . '</notify_url><call_back_url>' . $call_back_url . '</call_back_url><seller_account_name>' . $seller_email . '</seller_account_name><out_trade_no>' . $out_trade_no . '</out_trade_no><subject>' . $subject . '</subject><total_fee>' . $total_fee . '</total_fee><merchant_url>' . $merchant_url . '</merchant_url></direct_trade_create_req>';
     //echo "req_data";var_dump($req_data);echo "----------------------------------";
     //必填
     //构造要请求的参数数组,无需改动
     $para_token = array("service" => "alipay.wap.trade.create.direct", "partner" => trim($alipay_config['partner']), "sec_id" => $payment_type, "format" => $format, "v" => $v, "req_id" => $out_trade_no, "req_data" => trim($req_data), "_input_charset" => trim(strtolower($alipay_config['input_charset'])));
     //echo "<pre>";var_dump($para_token);echo "</pre>";die();
     //建立请求
     $alipaySubmit = new AlipaySubmit($alipay_config);
     $html_text = $alipaySubmit->buildRequestHttp($para_token);
     //var_dump($html_text);die();
     //URLDECODE返回的信息
     $html_text = urldecode($html_text);
     //echo "<pre>";var_dump($html_text);echo "</pre>";die();
     //解析远程模拟提交后返回的信息
     $para_html_text = $alipaySubmit->parseResponse($html_text);
     //var_dump($para_html_text);die;
     //获取request_token
     $request_token = $para_html_text['request_token'];
     //var_dump($request_token);
     /**************************根据授权码token调用交易接口alipay.wap.auth.authAndExecute**************************/
     //业务详细
     $req_data = '<auth_and_execute_req><request_token>' . $request_token . '</request_token></auth_and_execute_req>';
     //必填
     $parameter = array("service" => "alipay.wap.auth.authAndExecute", "partner" => trim($alipay_config['partner']), "sec_id" => $payment_type, "format" => $format, "v" => $v, "req_id" => $out_trade_no, "req_data" => trim($req_data), "_input_charset" => trim(strtolower($alipay_config['input_charset'])));
     //var_dump($parameter);die();
     $parameter1 = paraFilter($parameter);
     $parameter2 = argSort($parameter);
     //建立请求
     $alipaySubmit = new AlipaySubmit($alipay_config);
     $mysign = $alipaySubmit->buildRequestMysign($parameter2);
     $parameter2['sign'] = $mysign;
     //echo "<pre>";var_dump($parameter2);echo "</pre>";die();
     $html_text = $alipaySubmit->buildRequestForm($parameter2, "get", "确认");
     echo $html_text;
 }