當前位置: 首頁>>代碼示例>>PHP>>正文


PHP AlipaySubmit::buildRequestForm方法代碼示例

本文整理匯總了PHP中AlipaySubmit::buildRequestForm方法的典型用法代碼示例。如果您正苦於以下問題:PHP AlipaySubmit::buildRequestForm方法的具體用法?PHP AlipaySubmit::buildRequestForm怎麽用?PHP AlipaySubmit::buildRequestForm使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在AlipaySubmit的用法示例。


在下文中一共展示了AlipaySubmit::buildRequestForm方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: alipay_link

function alipay_link($params)
{
    #支付寶接口配置
    $type = $params['T'];
    $alipay_config['input_charset'] = 'utf-8';
    $alipay_config['sign_type'] = "MD5";
    $alipay_config['transport'] = $params['ssl'] ? "https" : "http";
    $alipay_config['partner'] = $params['partnerID'];
    $alipay_config['key'] = $params['security_code'];
    $alipay_config['seller_email'] = $params['seller_email'];
    $debug = $params["debug"];
    #係統變量
    $invoiceid = $params['invoiceid'];
    $description = $params["description"];
    $amount = $params['amount'];
    # Format: ##.##
    $currency = $params['currency'];
    # Currency Code
    $companyname = $params['companyname'];
    $systemurl = $params['systemurl'];
    $currency = $params['currency'];
    $alipay_config['return_url'] = $systemurl . "/modules/gateways/callback/alipay_return.php";
    $alipay_config['notify_url'] = $systemurl . "/modules/gateways/callback/alipay_callback.php";
    switch ($type) {
        case "1":
            $service_name = "create_direct_pay_by_user";
            break;
        case "2":
            $service_name = "create_partner_trade_by_buyer";
            break;
        case "3":
            $service_name = "trade_create_by_buyer";
            break;
        default:
    }
    //基本參數
    $parameter = array("service" => $service_name, "partner" => trim($alipay_config['partner']), "_input_charset" => trim(strtolower($alipay_config['input_charset'])), "return_url" => trim($alipay_config['return_url']), "sign_type" => trim($alipay_config['sign_type']), "notify_url" => trim($alipay_config['notify_url']));
    //業務參數
    $parameter["subject"] = "{$companyname} 訂單[ {$invoiceid} ]";
    $parameter["body"] = $description;
    $parameter["out_trade_no"] = $invoiceid;
    $parameter["price"] = $amount;
    $parameter["quantity"] = "1";
    $parameter["payment_type"] = "1";
    $parameter["seller_email"] = trim($alipay_config['seller_email']);
    if ($type != "1") {
        $parameter["logistics_fee"] = "0";
        $parameter["logistics_type"] = "EXPRESS";
        $parameter["logistics_payment"] = "SELLER_PAY";
    }
    $img = $systemurl . "/modules/gateways/callback/alipay.png";
    $alipaySubmit = new AlipaySubmit($alipay_config);
    $html_text = $alipaySubmit->buildRequestForm($parameter, "get", "確認");
    if ($debug) {
        $msg = "訂單: {$invoiceid} 生成支付表單 {$html_text}";
        logResult($msg);
    }
    $code = $html_text . "</form><a href='#' onclick=\"document.forms['alipaysubmit'].submit();\"><img src='{$img}' alt='點擊使用支付寶支付'> </a>";
    return $code;
}
開發者ID:frankwei98,項目名稱:WHMCS_Alipay,代碼行數:60,代碼來源:alipay.php

示例2: AliPay

	public function AliPay($data){
		$alipay_config['partner']		= $this->partner;
		$alipay_config['seller_email']	= $this->seller_email;
		$alipay_config['key']			= $this->paykey;
		$alipay_config['sign_type']    = strtoupper('MD5');//簽名方式
		$alipay_config['input_charset']= strtolower('utf-8');//字符編碼
		//$alipay_config['cacert']    = getcwd().'\\cacert.pem';
		$alipay_config['transport']    = 'http';
		
		$parameter = array(
				"service" 			=> "create_direct_pay_by_user",
				"partner" 			=> trim($alipay_config['partner']),
				"seller_email" 		=> trim($alipay_config['seller_email']),
				"payment_type"		=> '1',
				"notify_url"		=> $this->notify_url,
				"return_url"		=> $this->return_url,
				"out_trade_no"		=> $this->orderid,
				"subject"			=> $this->subject,
				"total_fee"			=> $this->price,
				"body"				=> $this->message,
				"show_url"			=> $this->show_url,
				"anti_phishing_key"	=> $this->anti_key,
				"exter_invoke_ip"	=> $this->exter_ip,
				"_input_charset"	=> trim(strtolower($alipay_config['input_charset']))
		);
		
		//建立請求
		$alipaySubmit = new AlipaySubmit($alipay_config);
		$html_text = $alipaySubmit->buildRequestForm($parameter,"get", $this->waitword);
		return $html_text;
	}
開發者ID:jl9n,項目名稱:phpstudy,代碼行數:31,代碼來源:AliPay即時到賬.php

示例3: _alipayto

  public function _alipayto(){

  //支付信息
$alipaySubmit = new AlipaySubmit($alipay_config);
//$anti_phishing_key = $alipaySubmit->query_timestamp();
$payment_type = "1";
$exter_invoke_ip = $_SERVER['REMOTE_ADDR'];
$out_trade_no = $row['pay_order_id'];
$parameter = array(
		"service" => "create_direct_pay_by_user",
		"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,
		"total_fee"	=> $total_fee,
		"body"	=> $body,
		//"show_url"	=> $show_url,
		//"anti_phishing_key"	=> $anti_phishing_key,
		"exter_invoke_ip"	=> $exter_invoke_ip,
		"_input_charset"	=> trim(strtolower($alipay_config['input_charset']))
);
//var_dump($parameter);exit;
	//建立請求
	//$alipaySubmit = new AlipaySubmit($alipay_config);
	$html_text = $alipaySubmit->buildRequestForm($parameter,"get", "確認");
	echo $html_text;
  //echo '提交成功';
  
  }
開發者ID:8yong8,項目名稱:vshop,代碼行數:32,代碼來源:Alipay.class.php

示例4: doalipay

 public function doalipay()
 {
     $recorder = M('Recorder');
     $rid = $_GET['rid'];
     $map['id'] = $rid;
     $map['userid'] = session('userid');
     $recinfo = $recorder->where($map)->find();
     if ($recinfo) {
         //這裏我們通過TP的C函數把配置項參數讀出,賦給$alipay_config;
         $alipay_config = C('alipay_config');
         $payment_type = "1";
         //支付類型 //必填,不能修改
         $notify_url = C('alipay.notify_url');
         //服務器異步通知頁麵路徑
         $return_url = C('alipay.return_url');
         //頁麵跳轉同步通知頁麵路徑
         $seller_email = C('alipay.seller_email');
         //賣家支付寶帳戶必填
         $parameter = array("service" => "create_direct_pay_by_user", "partner" => trim($alipay_config['partner']), "payment_type" => $payment_type, "notify_url" => $notify_url, "return_url" => $return_url, "seller_email" => $seller_email, "out_trade_no" => $recinfo['order_sn'], "subject" => '我愛換駕共享豆充值', "total_fee" => '0.01', "body" => '共享豆充值', "show_url" => '', "anti_phishing_key" => "", "exter_invoke_ip" => "", "_input_charset" => trim(strtolower($alipay_config['input_charset'])));
         $alipaySubmit = new \AlipaySubmit($alipay_config);
         echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">';
         $html_text = $alipaySubmit->buildRequestForm($parameter, "post", "確認");
         echo $html_text;
     }
 }
開發者ID:huangkaijin,項目名稱:clyy,代碼行數:25,代碼來源:PayController.class.php

示例5: get_code

 public function get_code($order)
 {
     require_once "lib/alipay_submit.class.php";
     $notify_url = U("Server/Index/aliguaranteebackn", array("id" => $order['id']), true, true);
     $return_url = U("Server/Order/detail", array("id" => $order['id']), true, true);
     $payment_type = "1";
     $out_trade_no = $order['order_id'];
     $subject = $this->ordername;
     $price = $order['price'];
     $quantity = "1";
     $logistics_fee = "0.00";
     $logistics_type = "EXPRESS";
     $logistics_payment = "SELLER_PAY";
     $body = $this->ordername;
     $show_url = "";
     $receive_name = "";
     $receive_address = "";
     $receive_zip = "";
     $receive_phone = "";
     $receive_mobile = "";
     $parameter = array("service" => "create_partner_trade_by_buyer", "partner" => trim($this->alipay_config['partner']), "seller_email" => trim($this->alipay_config['seller_email']), "payment_type" => $payment_type, "notify_url" => $notify_url, "return_url" => $return_url, "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($this->alipay_config['input_charset'])));
     $this->alipay_config['cacert'] = $this->cacert;
     $alipaySubmit = new AlipaySubmit($this->alipay_config);
     $html_text = $alipaySubmit->buildRequestForm($parameter, "get", "確認");
     return $html_text;
 }
開發者ID:crab890715,項目名稱:GoOut-Panel,代碼行數:26,代碼來源:guarantee.php

示例6: buildForm

 public function buildForm($request)
 {
     //構造要請求的參數數組,無需改動
     $req_id = date('Ymdhis');
     $req_data = '<direct_trade_create_req><notify_url>' . $this->notify_url . '</notify_url><call_back_url>' . $this->call_back_url . '</call_back_url><seller_account_name>' . $this->seller_email . '</seller_account_name><out_trade_no>' . $request->out_trade_no . '</out_trade_no><subject>' . $request->subject . '</subject><total_fee>' . $request->total_fee . '</total_fee><merchant_url>' . $this->merchant_url . '</merchant_url></direct_trade_create_req>';
     $para_token = array("service" => "alipay.wap.trade.create.direct", "partner" => trim($this->partner), "key" => $this->key, 'sec_id' => $this->sign_type, "format" => $this->format, "v" => $this->v, "req_id" => $req_id, "req_data" => $req_data, "_input_charset" => trim(strtolower($this->_input_charset)));
     //建立請求
     $alipaySubmit = new AlipaySubmit($this->alipay_config);
     $html_text = $alipaySubmit->buildRequestHttp($para_token);
     //URLDECODE返回的信息
     $html_text = urldecode($html_text);
     //解析遠程模擬提交後返回的信息
     $para_html_text = $alipaySubmit->parseResponse($html_text);
     //獲取request_token
     $request_token = $para_html_text['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($this->partner), 'sec_id' => $this->sign_type, "format" => $this->format, "v" => $this->v, "req_id" => $req_id, "req_data" => $req_data, "_input_charset" => trim(strtolower($this->_input_charset)));
     //建立請求
     $alipaySubmit = new AlipaySubmit($this->alipay_config);
     return $alipaySubmit->buildRequestForm($parameter, "get", "確認");
 }
開發者ID:linuxwit,項目名稱:mf,代碼行數:25,代碼來源:Alipay.php

示例7: alipayapi

 public function alipayapi()
 {
     // $username = Auth::user()->username;
     // $password = Input::get('password');
     // $userPassword = Auth::user()->password;
     // if (! Auth::validate(array('username'=>$username, 'password'=>$password))) {
     // 	return Redirect::back()
     // 		->with('message', 'wrong-credential');
     // }
     // dd(public_path());
     // require_once("alipay.config.php");
     // require_once("lib/alipay_submit.class.php");
     require_once public_path() . "/alipay/alipay.config.php";
     require_once public_path() . "/alipay/lib/alipay_submit.class.php";
     /**************************請求參數**************************/
     //商戶訂單號,商戶網站訂單係統中唯一訂單號,必填
     $out_trade_no = $_POST['WIDout_trade_no'];
     //訂單名稱,必填
     $subject = $_POST['WIDsubject'];
     //付款金額,必填
     $total_fee = $_POST['WIDtotal_fee'];
     //商品描述,可空
     $body = $_POST['WIDbody'];
     /************************************************************/
     //構造要請求的參數數組,無需改動
     $parameter = array("service" => $alipay_config['service'], "partner" => $alipay_config['partner'], "seller_id" => $alipay_config['seller_id'], "payment_type" => $alipay_config['payment_type'], "notify_url" => $alipay_config['notify_url'], "return_url" => $alipay_config['return_url'], "anti_phishing_key" => $alipay_config['anti_phishing_key'], "exter_invoke_ip" => $alipay_config['exter_invoke_ip'], "out_trade_no" => $out_trade_no, "subject" => $subject, "total_fee" => $total_fee, "body" => $body, "_input_charset" => trim(strtolower($alipay_config['input_charset'])));
     //建立請求
     $alipaySubmit = new AlipaySubmit($alipay_config);
     $html_text = $alipaySubmit->buildRequestForm($parameter, "get", "確認");
     echo $html_text;
 }
開發者ID:bytrix,項目名稱:witkey,代碼行數:31,代碼來源:AlipayController.php

示例8: recharge

 public function recharge()
 {
     $amount = intval($this->_post('amount'));
     if (!$amount) {
         $amount = intval($this->_get('amount'));
     }
     //
     $buyDiscount = 0;
     if (isset($_GET['discountpriceid'])) {
         $thisPrice = M('Agent_price')->where(array('id' => intval($_GET['discountpriceid'])))->find();
         $buyDiscount = 1;
         $amount = $thisPrice['price'];
     }
     if (!$amount) {
         $this->error('請填寫金額');
     }
     import("@.ORG.Alipay.AlipaySubmit");
     //支付類型
     $payment_type = "1";
     //必填,不能修改
     //服務器異步通知頁麵路徑
     $notify_url = C('site_url') . U('Agent/Pay/notify');
     //需http://格式的完整路徑,不能加?id=123這類自定義參數
     //頁麵跳轉同步通知頁麵路徑
     $return_url = C('site_url') . U('Agent/Pay/return_url', array('discountpriceid' => intval($_GET['discountpriceid'])));
     //需http://格式的完整路徑,不能加?id=123這類自定義參數,不能寫成http://localhost/
     //賣家支付寶帳戶
     $seller_email = trim(C('alipay_name'));
     //商戶訂單號
     $out_trade_no = $this->thisAgent['id'] . '_' . time();
     //商戶網站訂單係統中唯一訂單號,必填
     //訂單名稱
     if ($buyDiscount) {
         $subject = '購買優惠套餐' . $thisPrice['name'] . '(ID:' . $thisPrice['id'] . ')';
     } else {
         $subject = '充值' . $amount . '元';
     }
     //必填
     //付款金額
     $total_fee = $amount;
     $body = $subject;
     //商品展示地址
     $show_url = C('site_url') . U('Agent/Basic/expenseRecords');
     //需以http://開頭的完整路徑,例如:http://www.xxx.com/myorder.html
     //防釣魚時間戳
     $anti_phishing_key = "";
     //若要使用請調用類文件submit中的query_timestamp函數
     //客戶端的IP地址
     $exter_invoke_ip = "";
     //非局域網的外網IP地址,如:221.0.0.1
     $body = $subject;
     $data = M('Agent_expenserecords')->data(array('agentid' => $this->thisAgent['id'], 'des' => $subject, 'time' => time(), 'orderid' => $out_trade_no, 'amount' => $total_fee))->add();
     $show_url = rtrim(C('site_url'), '/');
     //構造要請求的參數數組,無需改動
     $parameter = array("service" => "create_direct_pay_by_user", "partner" => trim(C('alipay_pid')), "payment_type" => $payment_type, "notify_url" => $notify_url, "return_url" => $return_url, "seller_email" => $seller_email, "out_trade_no" => $out_trade_no, "subject" => $subject, "total_fee" => $total_fee, "body" => $body, "show_url" => $show_url, "anti_phishing_key" => $anti_phishing_key, "exter_invoke_ip" => $exter_invoke_ip, "_input_charset" => trim(strtolower('utf-8')));
     //建立請求
     $alipaySubmit = new AlipaySubmit($this->setconfig());
     $html_text = $alipaySubmit->buildRequestForm($parameter, "get", "確認支付");
     echo $html_text;
 }
開發者ID:d0oo0b,項目名稱:wechatcms,代碼行數:60,代碼來源:PayAction.class.php

示例9: pay

 public function pay()
 {
     $price = $_GET['price'];
     $orderName = $_GET['orderName'];
     if (!$orderName) {
         $orderName = microtime();
     }
     $orderid = $_GET['orderid'];
     if (!$orderid) {
         $orderid = $_GET['single_orderid'];
     }
     $alipayConfig = $this->alipayConfig;
     if (!$price) {
         exit('必須有價格才能支付');
     }
     import("@.ORG.Alipay.AlipaySubmit");
     $payment_type = "1";
     $notify_url = C('site_url') . '/index.php?g=Wap&m=Alipay&a=notify_url';
     $return_url = C('site_url') . '/index.php?g=Wap&m=Alipay&a=return_url';
     $seller_email = trim($alipayConfig['name']);
     $out_trade_no = $orderid;
     $subject = $orderName;
     $total_fee = floatval($price);
     $body = $orderName;
     $show_url = C('site_url') . U('Home/Index/price');
     $anti_phishing_key = "";
     $exter_invoke_ip = "";
     $body = $subject;
     $show_url = rtrim(C('site_url'), '/');
     $parameter = array("service" => "create_direct_pay_by_user", "partner" => trim($alipayConfig['pid']), "payment_type" => $payment_type, "notify_url" => $notify_url, "return_url" => $return_url, "seller_email" => $seller_email, "out_trade_no" => $out_trade_no, "subject" => $subject, "total_fee" => $total_fee, "body" => $body, "show_url" => $show_url, "anti_phishing_key" => $anti_phishing_key, "exter_invoke_ip" => $exter_invoke_ip, "_input_charset" => trim(strtolower('utf-8')));
     $alipaySubmit = new AlipaySubmit($this->setconfig());
     $html_text = $alipaySubmit->buildRequestForm($parameter, "get", "進行支付");
     echo '正在跳轉到支付寶進行支付...<div style="display:none">' . $html_text . '</div>';
 }
開發者ID:yakrsa,項目名稱:football,代碼行數:34,代碼來源:AlipaytypeAction.class.php

示例10: submit

    public function submit()
    {
        //請求業務參數詳細
        $req_data = '<direct_trade_create_req><notify_url>' . $this->notify_url . '</notify_url><call_back_url>' . $this->call_back_url . '</call_back_url><seller_account_name>' . $this->seller_email . '</seller_account_name><out_trade_no>' . $this->out_trade_no . '</out_trade_no><subject>' . $this->subject . '</subject><total_fee>' . $this->total_fee . '</total_fee></direct_trade_create_req>';
        //必填
        //構造要請求的參數數組,無需改動
        $para_token = array("service" => "alipay.wap.trade.create.direct", "partner" => trim($this->alipay_config['partner']), "sec_id" => trim($this->alipay_config['sign_type']), "format" => $this->format, "v" => $this->v, "req_id" => $this->req_id, "req_data" => $req_data, "_input_charset" => trim(strtolower($this->alipay_config['input_charset'])));
        //建立請求
        $alipaySubmit = new AlipaySubmit($this->alipay_config);
        $html_text = $alipaySubmit->buildRequestHttp($para_token);
        //URLDECODE返回的信息
        $html_text = urldecode($html_text);
        //解析遠程模擬提交後返回的信息
        $para_html_text = $alipaySubmit->parseResponse($html_text);
        //獲取request_token
        $request_token = $para_html_text['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($this->alipay_config['partner']), "sec_id" => trim($this->alipay_config['sign_type']), "format" => $this->format, "v" => $this->v, "req_id" => $this->req_id, "req_data" => $req_data, "_input_charset" => trim(strtolower($this->alipay_config['input_charset'])));
        //建立請求
        $alipaySubmit = new AlipaySubmit($this->alipay_config);
        $html_text = $alipaySubmit->buildRequestForm($parameter, 'get', '正在跳轉支付頁麵...');
        return '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
				<html>
				<head>
					<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
					<title>支付寶即時到賬交易接口接口</title>
				</head>' . $html_text . '
				</body>
				</html>';
    }
開發者ID:noikiy,項目名稱:haifenbao,代碼行數:34,代碼來源:alipay.php

示例11: post

 public function post()
 {
     $gid = $this->_post('gid', 'trim');
     $price = $this->_post('price', 'intval');
     if ($price == false || $this->_post('uname') == false) {
         $this->error('價格和用戶名必須填寫');
     }
     if ($gid != $this->_session('gid') && $this->_session('viptime') > time()) {
         $this->error('如需升級請聯係客服!');
     }
     import("@.ORG.Alipay.AlipaySubmit");
     $faceType = trim(C('faceType'));
     //**充值配置***//
     //支付類型
     $payment_type = "1";
     //必填,不能修改
     //服務器異步通知頁麵路徑
     $notify_url = C('site_url') . U('User/Alipay/notify');
     //需http://格式的完整路徑,不能加?id=123這類自定義參數
     //頁麵跳轉同步通知頁麵路徑
     $return_url = C('site_url') . U('User/Alipay/return_url');
     //需http://格式的完整路徑,不能加?id=123這類自定義參數,不能寫成http://localhost/
     //賣家支付寶帳戶
     $seller_email = trim(C('alipay_name'));
     //商戶訂單號
     $out_trade_no = session('uname') . time();
     //訂單名稱
     $subject = '充值vip' . $this->_post('group') . '會員' . $this->_post('num') . '個月';
     //付款金額
     $total_fee = (int) $_POST['price'];
     //商品數量
     $quantity = "1";
     $logistics_fee = "0.00";
     //必填,即運費
     //物流類型
     $logistics_type = "EXPRESS";
     //必填,三個值可選:EXPRESS(快遞)、POST(平郵)、EMS(EMS)
     //物流支付方式
     $logistics_payment = "SELLER_PAY";
     //必填,兩個值可選:SELLER_PAY(賣家承擔運費)、BUYER_PAY(買家承擔運費)
     //訂單描述
     $body = $subject;
     $data = M('Indent')->data(array('uid' => session('uid'), 'title' => $subject, 'uname' => $this->_post('uname'), 'gid' => $gid, 'create_time' => time(), 'indent_id' => $out_trade_no, 'price' => $total_fee, 'quantity' => $this->_post('num')))->add();
     $show_url = rtrim(C('site_url'), '/');
     ///***公用充值配置結束***//
     if ($faceType == '0') {
         //構造要請求的參數數組,無需改動
         $parameter = array("service" => "create_partner_trade_by_buyer", "partner" => trim(C('alipay_pid')), "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" => $total_fee, "quantity" => $quantity, "logistics_fee" => $logistics_fee, "logistics_type" => $logistics_type, "logistics_payment" => $logistics_payment, "body" => $body, "show_url" => $show_url, "_input_charset" => trim(strtolower(strtolower('utf-8'))));
     } elseif ($faceType == '1') {
         //構造要請求的參數數組,無需改動
         $parameter = array("service" => "create_direct_pay_by_user", "partner" => trim(C('alipay_pid')), "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" => $total_fee, "quantity" => $quantity, "logistics_fee" => $logistics_fee, "logistics_type" => $logistics_type, "logistics_payment" => $logistics_payment, "body" => $body, "show_url" => $show_url, "_input_charset" => trim(strtolower(strtolower('utf-8'))));
     } elseif ($faceType == '2') {
         //構造要請求的參數數組,無需改動
         $parameter = array("service" => "trade_create_by_buyer", "partner" => trim(C('alipay_pid')), "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" => $total_fee, "quantity" => $quantity, "logistics_fee" => $logistics_fee, "logistics_type" => $logistics_type, "logistics_payment" => $logistics_payment, "body" => $body, "show_url" => $show_url, "_input_charset" => trim(strtolower(strtolower('utf-8'))));
     }
     //建立請求
     $alipaySubmit = new AlipaySubmit($this->setconfig());
     $html_text = $alipaySubmit->buildRequestForm($parameter, "get", "確認");
     echo $html_text;
 }
開發者ID:fengsmith1988,項目名稱:weixin-1,代碼行數:60,代碼來源:AlipayAction.class.php

示例12: post

 public function post()
 {
     if ($this->_get('price') == false || $this->_get('uname') == false) {
         $this->error('價格和用戶名必須填寫');
     }
     import("@.ORG.Alipay.AlipaySubmit");
     $payment_type = "1";
     $notify_url = C('site_url') . U('User/Alipay/notify');
     $return_url = C('site_url') . U('User/Alipay/return_url', array('uid' => intval($_GET['uid'])));
     $seller_email = trim(C('alipay_name'));
     $out_trade_no = $this->_get('uid') . '_' . time();
     $subject = '充值vip' . $this->_get('group') . '會員' . $this->_get('num') . '個月';
     $total_fee = (int) $this->_get('price');
     $body = 'vip高級會員服務費';
     $show_url = C('site_url') . U('Home/Index/price');
     $anti_phishing_key = "";
     $exter_invoke_ip = "";
     $body = $subject;
     $data = M('Indent')->data(array('uid' => intval($_GET['uid']), 'month' => intval($this->_get('num')), 'title' => $subject, 'uname' => $this->_get('uname'), 'gid' => $this->_get('groupid'), 'create_time' => time(), 'indent_id' => $out_trade_no, 'price' => $total_fee))->add();
     $show_url = rtrim(C('site_url'), '/');
     $parameter = array("service" => "create_direct_pay_by_user", "partner" => trim(C('alipay_pid')), "payment_type" => $payment_type, "notify_url" => $notify_url, "return_url" => $return_url, "seller_email" => $seller_email, "out_trade_no" => $out_trade_no, "subject" => $subject, "total_fee" => $total_fee, "body" => $body, "show_url" => $show_url, "anti_phishing_key" => $anti_phishing_key, "exter_invoke_ip" => $exter_invoke_ip, "_input_charset" => trim(strtolower('utf-8')));
     $alipaySubmit = new AlipaySubmit($this->setconfig());
     $html_text = $alipaySubmit->buildRequestForm($parameter, "get", "確認");
     echo $html_text;
 }
開發者ID:yakrsa,項目名稱:football,代碼行數:25,代碼來源:AlipayReceiveAction.class.php

示例13: array

 function get_code($ologin) {
     $aliapy_config['partner'] = $ologin['alipaylogin_id'];
     $aliapy_config['key'] = $ologin['alipaylogin_key'];
     $aliapy_config['return_url'] = ologin::url(basename(__FILE__,'.php'));
     $aliapy_config['sign_type']    = 'MD5';
     $aliapy_config['input_charset']= 'utf-8';
     $aliapy_config['transport']    = 'http';
     //require_once("alipayauth/alipay_service.class.php");
     require_once("alipayauth/alipay_submit.class.php");
     $parameter = array(
                     "service" => "alipay.auth.authorize",
                     "target_service" => 'user.auth.quick.login',
                     "partner" => trim($aliapy_config['partner']),
                     "_input_charset" => trim(strtolower($aliapy_config['input_charset'])),
                     "return_url" => trim($aliapy_config['return_url']),
                     "anti_phishing_key" => '',
                     "exter_invoke_ip" => '',
     );
     ini_set("display_errors","On");
     //var_dump($aliapy_config);exit;
     $alipayService = new AlipaySubmit($aliapy_config);
     $login_url = $alipayService->buildRequestForm($parameter,"get", "");
     //file_put_contents('logs.txt',$login_url);exit;
     //var_dump($login_url);exit;
     echo $login_url;exit;
     return $login_url;
 }
開發者ID:jiangsuei8,項目名稱:public_php_shl,代碼行數:27,代碼來源:alipaylogin.php

示例14: pay

 public function pay($runValidation = true)
 {
     if ($runValidation && !$this->validate()) {
         return false;
     }
     if ($this->_order->status !== Order::STATUS_UNPAID) {
         return false;
     }
     try {
         switch ($this->platform) {
             case self::PLATFORM_ALIPAY:
                 require_once Yii::getAlias('@vendor') . '/payment/alipay/alipay.config.php';
                 require_once Yii::getAlias('@vendor') . '/payment/alipay/lib/alipay_submit.class.php';
                 $parameter = ['service' => 'create_direct_pay_by_user', 'partner' => trim($alipay_config['partner']), 'seller_email' => trim($alipay_config['seller_email']), 'payment_type' => '1', 'notify_url' => Url::to(['/payment/alipay-order-notify'], true), 'return_url' => Url::to(['/payment/alipay-order-return'], true), 'out_trade_no' => $this->_order->order_sn, 'subject' => '訂單支付', 'total_fee' => $this->_order->real_fee, 'body' => '笑e購(xiaoego.com)訂單,訂單號:' . $this->_order->order_sn, 'show_url' => Url::to(['/order/detail', 'order' => $this->_order->order_sn], true), 'anti_phishing_key' => '', 'exter_invoke_ip' => '', '_input_charset' => trim(strtolower($alipay_config['input_charset']))];
                 //建立請求
                 $alipaySubmit = new \AlipaySubmit($alipay_config);
                 $htmlText = $alipaySubmit->buildRequestForm($parameter, 'post', '');
                 break;
             default:
                 throw new InvalidValueException();
         }
         return $htmlText;
     } catch (\Exception $e) {
         return false;
     }
 }
開發者ID:daixianceng,項目名稱:xiaoego.com,代碼行數:26,代碼來源:PayOrderForm.php

示例15: config

 public function config($config = null)
 {
     $format = "xml";
     $req_id = date('Ymdhis');
     $merchant_url = "";
     $notify_url = $config['NotifyUrl'];
     $return_url = $config['ReturnUrl'];
     $seller_email = $config['pay_type_data']['user']['val'];
     $out_trade_no = $config['code'];
     $subject = $config['title'];
     $total_fee = $config['money'];
     $wapalipay_config_id = trim($config['id']);
     $wapalipay_config_key = trim($config['key']);
     $wapalipay_config_input_charset = strtolower('utf-8');
     $wapalipay_config_sign_type = strtoupper('MD5');
     $wapalipay_config_input_charset = strtolower('utf-8');
     $wapalipay_config_cacert = dirname(__FILE__) . DIRECTORY_SEPARATOR . "wapalipay" . DIRECTORY_SEPARATOR . "cacert.pem";
     $wapalipay_config_private_key_path = '.' . DIRECTORY_SEPARATOR . 'wapalipay' . DIRECTORY_SEPARATOR . 'rsa_private_key.pem';
     $wapalipay_config_ali_public_key_path = '.' . DIRECTORY_SEPARATOR . 'wapalipay' . DIRECTORY_SEPARATOR . 'alipay_public_key.pem';
     $wapalipay_config_transport = 'http';
     $wapalipay_config = array("partner" => $wapalipay_config_id, "key" => $wapalipay_config_key, "private_key_path" => $wapalipay_config_private_key_path, "ali_public_key_path" => $wapalipay_config_ali_public_key_path, "sign_type" => $wapalipay_config_sign_type, "input_charset" => $wapalipay_config_input_charset, "cacert" => $wapalipay_config_cacert, "transport" => $wapalipay_config_transport);
     $req_data = '<direct_trade_create_req><notify_url>' . $notify_url . '</notify_url><call_back_url>' . $return_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>';
     $para_token = array("service" => "alipay.wap.trade.create.direct", "partner" => trim($config['id']), "sec_id" => $wapalipay_config_sign_type, "format" => $format, "v" => "2.0", "req_id" => $req_id, "req_data" => $req_data, "_input_charset" => $wapalipay_config_input_charset);
     $wapalipaySubmit = new AlipaySubmit($wapalipay_config);
     $html_text = $wapalipaySubmit->buildRequestHttp($para_token);
     $html_text = urldecode($html_text);
     $para_html_text = $wapalipaySubmit->parseResponse($html_text);
     $request_token = $para_html_text['request_token'];
     $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($config['id']), "sec_id" => $wapalipay_config_sign_type, "format" => $format, "v" => "2.0", "req_id" => $req_id, "req_data" => $req_data, "_input_charset" => $wapalipay_config_input_charset);
     $wapalipaySubmit = new AlipaySubmit($wapalipay_config);
     $this->url = $wapalipaySubmit->buildRequestForm($parameter, 'get', '確認');
 }
開發者ID:ping199143,項目名稱:1ydb,代碼行數:33,代碼來源:wapalipay.class.php


注:本文中的AlipaySubmit::buildRequestForm方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。