AlipaySubmit::buildRequestParaToString PHP Method

buildRequestParaToString() public method

生成要请求给支付宝的参数数组
public buildRequestParaToString ( $para_temp ) : 要请求的参数数组字符串
$para_temp 请求前的参数数组
return 要请求的参数数组字符串
    function buildRequestParaToString($para_temp)
    {
        //待请求参数数组
        $para = $this->buildRequestPara($para_temp);
        //把参数组中所有元素,按照“参数=参数值”的模式用“&”字符拼接成字符串,并对字符串做urlencode编码
        $request_data = createLinkstringUrlencode($para);
        return $request_data;
    }

Usage Example

Esempio n. 1
0
 public function outPayForUrl($order, $notify_url, $return_url)
 {
     $alipaySubmit = new AlipaySubmit($this->config);
     //支付类型
     $payment_type = "1";
     //卖家支付宝帐户
     $seller_email = $this->config['account'];
     //必填
     //商户订单号
     $out_trade_no = $order['ordersn'];
     //商户网站订单系统中唯一订单号,必填
     //订单名称
     $subject = $order['ordertitle'];
     //必填
     //付款金额
     $total_fee = $order['orderprice'];
     //必填
     //订单描述
     $body = $order['orderdescribe'];
     //商品展示地址
     $show_url = 'index.php?item-app-order&ordersn=' . $order['ordersn'];
     //需以http://开头的完整路径,例如:http://www.xxx.com/myorder.html
     //防钓鱼时间戳
     $anti_phishing_key = "";
     //若要使用请调用类文件submit中的query_timestamp函数
     //客户端的IP地址
     $exter_invoke_ip = "";
     //非局域网的外网IP地址,如:221.0.0.1
     //构造要请求的参数数组,无需改动
     $parameter = array("service" => "trade_create_by_buyer", "partner" => trim($this->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, "logistics_type" => 'EXPRESS', "logistics_fee" => 0, "logistics_payment" => 'SELLER_PAY', "price" => $total_fee, "quantity" => 1, "body" => $body, "show_url" => $show_url, "anti_phishing_key" => $anti_phishing_key, "exter_invoke_ip" => $exter_invoke_ip, "_input_charset" => trim(strtolower($this->config['input_charset'])));
     $url = $alipaySubmit->alipay_gateway_new . $alipaySubmit->buildRequestParaToString($parameter);
     unset($alipaySubmit);
     return $url;
 }
All Usage Examples Of AlipaySubmit::buildRequestParaToString