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


PHP AlipaySubmit::parseResponse方法代碼示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: pay

	public function pay()
	{
		$orderName = htmlentities($_GET['orderName']);
		$orderid = htmlentities($_GET['orderid']);
		$from = htmlentities($_GET['from']);

		if (!$orderName) {
			$orderName = microtime();
		}

		if (!$orderid) {
			$orderid = htmlentities($_GET['single_orderid']);
		}

		$payHandel = new payHandle($this->token, $from, 'alipay');
		$orderInfo = $payHandel->beforePay($orderid);
		$price = $orderInfo['price'];

		if ($orderInfo['paid']) {
			exit('您已經支付過此次訂單!');
		}

		if (!$price) {
			exit('必須有價格才能支付');
		}

		require_once $this->base_path . 'lib/alipay_submit.class.php';
		$format = 'xml';
		$v = '2.0';
		$req_id = date('Ymdhis');
		if (($_GET['platform'] || $_GET['pl']) && C('platform_open') && C('platform_alipay_open')) {
			$query_string_base = 'token=' . $this->token . '|wecha_id=' . $this->wecha_id . '|from=' . $from . '|pl=1';
			$query_string_base_notify = 'token||' . $this->token . '|wecha_id||' . $this->wecha_id . '|from||' . $from . '|pl||1';
		}
		else {
			$query_string_base = 'token=' . $this->token . '|wecha_id=' . $this->wecha_id . '|from=' . $from;
			$query_string_base_notify = 'token||' . $this->token . '|wecha_id||' . $this->wecha_id . '|from||' . $from;
		}

		$notify_url = C('site_url') . '/wxpay/alipaytype_notify_url.php?user_params=' . $query_string_base_notify;
		$call_back_url = C('site_url') . '/wxpay/alipaytype_call_back_url.php?user_params=' . $query_string_base;
		$merchant_url = C('site_url') . '/wxpay/alipaytype_break.php';
		$out_trade_no = $orderid;
		$subject = $orderName;
		$total_fee = $price;
		$req_data = '<direct_trade_create_req><notify_url>' . $notify_url . '</notify_url><call_back_url>' . $call_back_url . '</call_back_url><seller_account_name>' . trim($this->alipay_config['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($this->alipay_config['partner']), 'sec_id' => trim($this->alipay_config['sign_type']), 'format' => $format, 'v' => $v, 'req_id' => $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);
		$html_text = urldecode($html_text);
		$para_html_text = $alipaySubmit->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($this->alipay_config['partner']), 'sec_id' => trim($this->alipay_config['sign_type']), 'format' => $format, 'v' => $v, 'req_id' => $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', '確認');
		header('Content-type: text/html; charset=utf-8');
		echo $html_text;
	}
開發者ID:kevicki,項目名稱:pig,代碼行數:59,代碼來源:AlipaytypeAction.class.php

示例5: date

 /**
  * 生成支付代碼
  * @param   array   $order  訂單信息
  * @param   array   $payment    支付方式信息
  */
 function get_wappay_url($order, $payment)
 {
     $order_id = $order['order_id'];
     $order_desc = $order['order_sn'];
     $order_sn = $order['order_sn'];
     $amount = $order['order_amount'];
     $ecmobile_url = ecmobile_url();
     //修正配置文件路徑
     $this->alipay_config = $this->modify_config_path($this->alipay_config);
     $format = "xml";
     //返回格式
     $v = "2.0";
     $req_id = date('Ymdhis');
     //請求號
     $notify_url = $ecmobile_url . "/payment/alipay/wap/notify_url.php";
     //服務器異步通知頁麵路徑
     $call_back_url = $ecmobile_url . "/payment/wap_callback.php?code=alipay";
     //頁麵跳轉同步通知頁麵路徑
     $merchant_url = $ecmobile_url . "/payment/wap_merchant.php?code=alipay";
     //操作中斷返回地址
     $seller_email = 'pay@geek-zoo.com';
     //賣家支付寶帳戶
     $out_trade_no = $order_sn;
     //商戶訂單號
     $subject = $order_desc;
     //訂單名稱
     $total_fee = $amount;
     //付款金額
     //請求業務參數詳細
     $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>';
     $para_token = array("service" => "alipay.wap.trade.create.direct", "partner" => trim($this->alipay_config['partner']), "sec_id" => trim($this->alipay_config['sign_type']), "format" => $format, "v" => $v, "req_id" => $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);
     $html_text = urldecode($html_text);
     //解析遠程模擬提交後返回的信息
     $para_html_text = $alipaySubmit->parseResponse($html_text);
     //獲取request_token
     $request_token = $para_html_text['request_token'];
     if ($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($this->alipay_config['partner']), "sec_id" => trim($this->alipay_config['sign_type']), "format" => $format, "v" => $v, "req_id" => $req_id, "req_data" => $req_data, "_input_charset" => trim(strtolower($this->alipay_config['input_charset'])));
         //建立請求
         $alipaySubmit = new AlipaySubmit($this->alipay_config);
         $url = $alipaySubmit->alipay_gateway_new . $alipaySubmit->buildRequestParaToString($parameter);
         return $url;
     } else {
         return false;
     }
 }
開發者ID:dx8719,項目名稱:ECMobile_Universal,代碼行數:57,代碼來源:alipay_mobile.php

示例6: submit

    public function submit($param)
    {
        $this->format = 'xml';
        $this->v = '2.0';
        $this->req_id = date('Ymdhis');
        $this->notify_url = MOBILE_SITE_URL . '/api/payment/alipay/notify_url.php';
        $this->call_back_url = MOBILE_SITE_URL . '/api/payment/alipay/call_back_url.php';
        $this->seller_email = $param['alipay_account'];
        //v3-b11
        $this->out_trade_no = $param['order_sn'] . '-' . $param['order_type'];
        $this->subject = $param['order_sn'];
        $this->total_fee = $param['order_amount'];
        $this->alipay_config = array('partner' => $param['alipay_partner'], 'key' => $param['alipay_key'], 'private_key_path' => 'key/rsa_private_key.pem', 'ali_public_key_path' => 'key/alipay_public_key.pem', 'sign_type' => 'MD5', 'input_charset' => 'utf-8', 'cacert' => getcwd() . '\\cacert.pem', 'transport' => 'http');
        //請求業務參數詳細
        $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:1290800466,項目名稱:mac_win,代碼行數:45,代碼來源:alipay.php

示例7: array

 /**
  * 生成支付代碼
  * @param   array   $order      訂單信息
  * @param   array   $payment    支付方式信息
  */
 function get_code($order, $payment)
 {
     if (!defined('EC_CHARSET')) {
         $charset = 'utf-8';
     } else {
         $charset = EC_CHARSET;
     }
     $alipay_config = array();
     $alipay_config['partner'] = $payment['alipay_partner'];
     //安全檢驗碼,以數字和字母組成的32位字符
     //如果簽名方式設置為“MD5”時,請設置該參數
     $alipay_config['key'] = $payment['alipay_key'];
     //商戶的私鑰(後綴是.pen)文件相對路徑
     //如果簽名方式設置為“0001”時,請設置該參數
     //$alipay_config['private_key_path']	= 'key/rsa_private_key.pem';
     //支付寶公鑰(後綴是.pen)文件相對路徑
     //如果簽名方式設置為“0001”時,請設置該參數
     // $alipay_config['ali_public_key_path']= 'key/alipay_public_key.pem';
     //簽名方式 不需修改
     $alipay_config['sign_type'] = 'MD5';
     //字符編碼格式 目前支持 gbk 或 utf-8
     $alipay_config['input_charset'] = 'utf-8';
     $alipay_config['cacert'] = '';
     // $alipay_config['cacert']    = ROOT_PATH .'mobile/includes/modules/cacert.pem';
     //ca證書路徑地址,用於curl中ssl校驗
     //請保證cacert.pem文件在當前文件夾目錄中
     //$alipay_config['cacert']    = getcwd().'\\cacert.pem';
     //訪問模式,根據自己的服務器是否支持ssl訪問,若支持請選擇https;若不支持請選擇http
     $alipay_config['transport'] = 'http';
     require_once ROOT_PATH . "includes/modules/lib/alipay_submit.class.php";
     $format = "xml";
     //必填,不需要修改
     //返回格式
     $v = "2.0";
     //必填,不需要修改
     //請求號
     $req_id = date('Ymdhis');
     //必填,須保證每次請求都是唯一
     //**req_data詳細信息**
     //服務器異步通知頁麵路徑
     $notify_url = $GLOBALS['hhs']->url() . 'alipay/notify_url.php';
     //需http://格式的完整路徑,不允許加?id=123這類自定義參數
     //頁麵跳轉同步通知頁麵路徑
     $call_back_url = $GLOBALS['hhs']->url() . 'alipay/alipay.php';
     $seller_email = $payment['alipay_account'];
     //必填
     //商戶訂單號
     $out_trade_no = $order['order_sn'] . time();
     //商戶網站訂單係統中唯一訂單號,必填
     //訂單名稱
     $subject = $order['order_sn'];
     //必填
     //付款金額
     $total_fee = $order['order_amount'];
     //必填
     //請求業務參數詳細
     $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></direct_trade_create_req>';
     //構造要請求的參數數組,無需改動
     $para_token = array("service" => "alipay.wap.trade.create.direct", "partner" => trim($alipay_config['partner']), "sec_id" => trim($alipay_config['sign_type']), "format" => $format, "v" => $v, "req_id" => $req_id, "req_data" => $req_data, "_input_charset" => trim(strtolower($alipay_config['input_charset'])));
     //建立請求
     $alipaySubmit = new AlipaySubmit($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($alipay_config['partner']), "v" => $v, "sec_id" => trim($alipay_config['sign_type']), "format" => $format, "req_id" => $req_id, "req_data" => $req_data, "_input_charset" => trim(strtolower($alipay_config['input_charset'])));
     //建立請求
     $alipaySubmit = new AlipaySubmit($alipay_config);
     $html_text = $alipaySubmit->buildRequestForm($parameter, 'get', '確認');
     //var_dump($html_text);
     return $html_text;
     return $html_text;
 }
開發者ID:shiruolin,項目名稱:hzzshop,代碼行數:86,代碼來源:alipay.php

示例8: dopay

 public function dopay()
 {
     if (!$this->token) {
         echo 'token不能為空';
         exit;
     }
     if (!$this->order) {
         $name = "Product";
         $back = U($name . "/my", array('token' => $this->token, 'wecha_id' => $this->wecha_id));
         $this->error('訂單不能為空', U($name . $back));
     }
     $order = $this->order;
     $product = $this->product;
     $alipay_config = $this->alipay_config;
     //返回格式
     $format = "xml";
     //必填,不需要修改
     //返回格式
     $v = "2.0";
     //必填,不需要修改
     //請求號
     $req_id = date('Ymdhis');
     //必填,須保證每次請求都是唯一
     //服務器異步通知頁麵路徑
     $notify_url = C('site_url') . '/api/malipay/notify_url.php';
     //需http://格式的完整路徑,不允許加?id=123這類自定義參數
     //頁麵跳轉同步通知頁麵路徑
     $call_back_url = C('site_url') . '/api/malipay/call_back_url.php';
     //需http://格式的完整路徑,不允許加?id=123這類自定義參數
     //賣家支付寶帳戶
     //$seller_email = $_POST['WIDseller_email'];
     $seller_email = $this->pay_m_alipay_config['name'];
     //必填
     //商戶訂單號
     //$out_trade_no = $_POST['WIDout_trade_no'];
     $out_trade_no = $order['sn'];
     //商戶網站訂單係統中唯一訂單號,必填
     //訂單名稱
     //$subject = $_POST['WIDsubject'];
     $subject = $product['name'];
     //必填
     //付款金額
     //$total_fee = $_POST['WIDtotal_fee'];
     $total_fee = $order['price'];
     //必填
     //請求業務參數詳細
     $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></direct_trade_create_req>';
     //必填
     /************************************************************/
     //構造要請求的參數數組,無需改動
     $para_token = array("service" => "alipay.wap.trade.create.direct", "partner" => trim($alipay_config['partner']), "sec_id" => trim($alipay_config['sign_type']), "format" => $format, "v" => $v, "req_id" => $req_id, "req_data" => $req_data, "_input_charset" => trim(strtolower($alipay_config['input_charset'])));
     //建立請求
     $alipaySubmit = new AlipaySubmit($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($alipay_config['partner']), "sec_id" => trim($alipay_config['sign_type']), "format" => $format, "v" => $v, "req_id" => $req_id, "req_data" => $req_data, "_input_charset" => trim(strtolower($alipay_config['input_charset'])));
     //建立請求
     $alipaySubmit = new AlipaySubmit($alipay_config);
     $html_text = $alipaySubmit->buildRequestForm($parameter, 'get', '正確為您跳轉到支付寶支付界麵!');
     echo $html_text;
 }
開發者ID:yakrsa,項目名稱:football,代碼行數:71,代碼來源:Pay_m_alipayAction.class.php

示例9: orderWapPay

 public function orderWapPay($orderGlideId)
 {
     $orderPayGlideService = utils::getService('orderPayGlide');
     $orderGlideInfo = $orderPayGlideService->find($orderGlideId);
     $alipay_config = utils::c('aliwappay');
     $format = "xml";
     $v = "2.0";
     $req_id = date('Ymdhis');
     $notify_url = utils::c('siteUrl') . '/mobile/order/ali-pay-notify';
     $call_back_url = utils::c('siteUrl') . '/mobile/order/ali-pay-back';
     $merchant_url = utils::c('siteUrl') . '/mobile/order';
     $out_trade_no = $orderGlideInfo['glide_nums'];
     $subject = '宅配訂單' . $orderGlideInfo['glide_nums'];
     $total_fee = $orderGlideInfo['total'];
     $req_data = '<direct_trade_create_req><notify_url>' . $notify_url . '</notify_url><call_back_url>' . $call_back_url . '</call_back_url><seller_account_name>' . trim($alipay_config['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($alipay_config['partner']), "sec_id" => trim($alipay_config['sign_type']), "format" => $format, "v" => $v, "req_id" => $req_id, "req_data" => $req_data, "_input_charset" => trim(strtolower($alipay_config['input_charset'])));
     $alipaySubmit = new AlipaySubmit($alipay_config);
     $html_text = $alipaySubmit->buildRequestHttp($para_token);
     $html_text = urldecode($html_text);
     $para_html_text = $alipaySubmit->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($alipay_config['partner']), "sec_id" => trim($alipay_config['sign_type']), "format" => $format, "v" => $v, "req_id" => $req_id, "req_data" => $req_data, "_input_charset" => trim(strtolower($alipay_config['input_charset'])));
     $alipaySubmit = new AlipaySubmit($alipay_config);
     $htmlText = $alipaySubmit->buildRequestForm($parameter, 'get', '支付寶支付');
     return $htmlText;
 }
開發者ID:lzmyoyo,項目名稱:ninxingfu,代碼行數:27,代碼來源:orderService.php

示例10: array

$out_trade_no = $pay['out_trade_no'];
$total_fee = $pay['total_fee'];
//必填
//請求業務參數詳細
$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></direct_trade_create_req>';
//必填
/************************************************************/
//構造要請求的參數數組,無需改動
$para_token = array("service" => "alipay.wap.trade.create.direct", "partner" => trim($alipay_config['partner']), "sec_id" => trim($alipay_config['sign_type']), "format" => $format, "v" => $v, "req_id" => $req_id, "req_data" => $req_data, "_input_charset" => trim(strtolower($alipay_config['input_charset'])));
//建立請求
$alipaySubmit = new AlipaySubmit($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($alipay_config['partner']), "sec_id" => trim($alipay_config['sign_type']), "format" => $format, "v" => $v, "req_id" => $req_id, "req_data" => $req_data, "_input_charset" => trim(strtolower($alipay_config['input_charset'])));
//print_r($parameter); exit;
//建立請求
$alipaySubmit = new AlipaySubmit($alipay_config);
$html_text = $alipaySubmit->buildRequestForm($parameter, 'get', '頁麵跳轉中,如果未跳轉點此');
echo $html_text;
?>
</body>
開發者ID:myjavawork,項目名稱:sanxin-fangwei,代碼行數:31,代碼來源:alipayapi.php

示例11: aliPay

 public function aliPay(Request $request)
 {
     require_once app_path() . "/Tool/Alipay/alipay.config.php";
     require_once app_path() . "/Tool/Alipay/lib/alipay_submit.class.php";
     //返回格式
     $format = "xml";
     //必填,不需要修改
     //返回格式
     $v = "2.0";
     //必填,不需要修改
     //請求號
     $req_id = date('Ymdhis');
     //必填,須保證每次請求都是唯一
     //**req_data詳細信息**
     //服務器異步通知頁麵路徑
     $notify_url = "http://" . $_SERVER['HTTP_HOST'] . '/service/pay/ali_notify';
     //需http://格式的完整路徑,不允許加?id=123這類自定義參數
     //頁麵跳轉同步通知頁麵路徑
     $call_back_url = "http://" . $_SERVER['HTTP_HOST'] . '/service/pay/ali_result';
     //需http://格式的完整路徑,不允許加?id=123這類自定義參數
     //http://127.0.0.1:8800/WS_WAP_PAYWAP-PHP-UTF-8/call_back_url.php
     //操作中斷返回地址
     $merchant_url = "http://" . $_SERVER['HTTP_HOST'] . '/service/pay/ali_merchant';
     //用戶付款中途退出返回商戶的地址。需http://格式的完整路徑,不允許加?id=123這類自定義參數
     //賣家支付寶帳戶
     $seller_email = 'william@speakez.cn';
     //必填
     //商戶訂單號
     $out_trade_no = $_POST['order_no'];
     //商戶網站訂單係統中唯一訂單號,必填
     Log::info('out_trade_no:' . $out_trade_no);
     //訂單名稱
     $subject = $_POST['name'];
     //必填
     //付款金額
     $total_fee = $_POST['total_price'];
     //必填
     //請求業務參數詳細
     $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>';
     //必填
     /************************************************************/
     //構造要請求的參數數組,無需改動
     $para_token = array("service" => "alipay.wap.trade.create.direct", "partner" => trim($alipay_config['partner']), "sec_id" => trim($alipay_config['sign_type']), "format" => $format, "v" => $v, "req_id" => $req_id, "req_data" => $req_data, "_input_charset" => trim(strtolower($alipay_config['input_charset'])));
     //建立請求
     $alipaySubmit = new \AlipaySubmit($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($alipay_config['partner']), "sec_id" => trim($alipay_config['sign_type']), "format" => $format, "v" => $v, "req_id" => $req_id, "req_data" => $req_data, "_input_charset" => trim(strtolower($alipay_config['input_charset'])));
     //建立請求
     $alipaySubmit = new \AlipaySubmit($alipay_config);
     $html_text = $alipaySubmit->buildRequestForm($parameter, 'get', '確認');
     return $html_text;
 }
開發者ID:yin32167,項目名稱:lesson-laravel,代碼行數:63,代碼來源:PayController.php

示例12: array

 function pay_order()
 {
     $order_sn = $this->uri->segment(3);
     require_once "walipay/alipay.config.php";
     require_once "walipay/lib/alipay_submit.class.php";
     $alipay_config_temp = $this->tickets->select('payment', array('name' => 'alipay'));
     $alipay_con = $alipay_config_temp[0];
     /**************************調用授權接口alipay.wap.trade.create.direct獲取授權碼token**************************/
     //返回格式
     $format = "xml";
     //必填,不需要修改
     //返回格式
     $v = "2.0";
     //必填,不需要修改
     //請求號
     $req_id = date('Ymdhis');
     //必填,須保證每次請求都是唯一
     //操作中斷返回地址
     $merchant_url = base_url() . "mobile_return_url.php";
     //用戶付款中途退出返回商戶的地址。需http://格
     $notify_url = base_url() . "wechat/notify_url";
     //需http://格式的完整路徑,不允許加?id=123這類自定義參數
     //頁麵跳轉同步通知頁麵路徑
     $call_back_url = base_url() . "return_url.php";
     //需http://格式的完整路徑,不能加?id=123這類自定義參數,不能寫成http://localhost/
     $o = $this->tickets->select('orders', array('to_order_sn' => $order_sn));
     //賣家支付寶帳戶
     $seller_email = $alipay_con->payname;
     //'liuxiaofeng@xiaoshuhaochi.com';
     //必填
     //商戶訂單號
     $out_trade_no = $order_sn;
     //商戶網站訂單係統中唯一訂單號,必填
     $req_id = date('Ymdhis');
     $this->tickets->update('orders', array('to_alipay_sn' => $req_id), array('to_order_sn' => $order_sn));
     //訂單名稱
     $subject = $o[0]->to_receiver . '新訂單';
     //付款金額
     $total_fee = $o[0]->to_order_amount;
     //必填
     //請求業務參數詳細
     $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>';
     //必填
     /************************************************************/
     $alipay_config['partner'] = $alipay_con->app_id;
     $alipay_config['key'] = $alipay_con->app_secret;
     //構造要請求的參數數組,無需改動
     $para_token = array("service" => "alipay.wap.trade.create.direct", "partner" => trim($alipay_config['partner']), "sec_id" => trim($alipay_config['sign_type']), "format" => $format, "v" => $v, "req_id" => $req_id, "req_data" => $req_data, "_input_charset" => trim(strtolower($alipay_config['input_charset'])));
     //建立請求
     $alipaySubmit = new AlipaySubmit($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($alipay_config['partner']), "sec_id" => trim($alipay_config['sign_type']), "format" => $format, "v" => $v, "req_id" => $req_id, "req_data" => $req_data, "_input_charset" => trim(strtolower($alipay_config['input_charset'])));
     //建立請求
     $alipaySubmit = new AlipaySubmit($alipay_config);
     $html_text = $alipaySubmit->buildRequestForm($parameter, 'get', '確認');
     $data['text'] = $html_text;
     $this->load->view('main/pay_channel', $data);
 }
開發者ID:snamper,項目名稱:CI_xiaoshuhaochi,代碼行數:69,代碼來源:wechat.php

示例13: wapalipay

 public function wapalipay()
 {
     vendor('Malipay.alipay_submit', '', '.class.php');
     $alipay_config = $this->wapalipay_config;
     $order = $this->order;
     //返回格式
     $format = "xml";
     $v = "2.0";
     $req_id = date('Ymdhis');
     $notify_url = C('site_url') . '/index.php/Wap/Pay/wapalipay_notify_url';
     $call_back_url = C('site_url') . '/index.php/Wap/Pay/wapalipay_call_back_url';
     $seller_email = $alipay_config['seller_email'];
     $out_trade_no = $order['orderid'];
     $subject = $order['ordername'];
     $total_fee = $order['price'];
     //請求業務參數詳細
     $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></direct_trade_create_req>';
     //構造要請求的參數數組,無需改動
     $para_token = array("service" => "alipay.wap.trade.create.direct", "partner" => trim($alipay_config['partner']), "sec_id" => trim($alipay_config['sign_type']), "format" => $format, "v" => $v, "req_id" => $req_id, "req_data" => $req_data, "_input_charset" => trim(strtolower($alipay_config['input_charset'])));
     //建立請求
     $alipaySubmit = new AlipaySubmit($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($alipay_config['partner']), "sec_id" => trim($alipay_config['sign_type']), "format" => $format, "v" => $v, "req_id" => $req_id, "req_data" => $req_data, "_input_charset" => trim(strtolower($alipay_config['input_charset'])));
     //建立請求
     $alipaySubmit = new AlipaySubmit($alipay_config);
     $html_text = $alipaySubmit->buildRequestForm($parameter, 'get', '正確為您跳轉到支付寶支付界麵!');
     echo '正在跳轉到支付寶進行支付...<div style="display:none">' . $html_text . '</div>';
 }
開發者ID:tang1007,項目名稱:weixin,代碼行數:39,代碼來源:PayAction.class.php

示例14: import

 function ali_pay()
 {
     import('@.ORG.Alipay.alipay_submit');
     $args = func_get_args();
     if (!$args[0] || !$args[1] || !$args[2]) {
         //0訂單編號,商品描述,2訂單金額,
         return false;
     }
     $path = C('Alipay_path');
     $config = (require $_SERVER['DOCUMENT_ROOT'] . $path . "config.php");
     //返回格式
     $format = "xml";
     //必填,不需要修改
     //返回格式
     $v = "2.0";
     //必填,不需要修改
     //請求號
     $req_id = date('Ymdhis');
     //必填,須保證每次請求都是唯一
     //**req_data詳細信息**
     //服務器異步通知頁麵路徑
     $notify_url = "http://" . $_SERVER['HTTP_HOST'] . '/alipay/notify_url.php';
     //需http://格式的完整路徑,不允許加?id=123這類自定義參數
     //頁麵跳轉同步通知頁麵路徑
     $call_back_url = "http://" . $_SERVER['HTTP_HOST'] . '/alipay/call_back.php';
     //需http://格式的完整路徑,不允許加?id=123這類自定義參數
     //操作中斷返回地址
     $merchant_url = "http://" . $_SERVER['HTTP_HOST'] . '/alipay/call_back.php';
     //用戶付款中途退出返回商戶的地址。需http://格式的完整路徑,不允許加?id=123這類自定義參數
     //商戶訂單號
     $out_trade_no = $args[0];
     //商戶網站訂單係統中唯一訂單號,必填
     //訂單名稱
     $subject = $args[1];
     //必填
     //付款金額
     $total_fee = $args[2];
     //必填
     //請求業務參數詳細
     $req_data = '<direct_trade_create_req><notify_url>' . $notify_url . '</notify_url><call_back_url>' . $call_back_url . '</call_back_url><seller_account_name>' . trim($alipay_config['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>';
     //必填
     //var_dump($req_data);die();
     /************************************************************/
     //構造要請求的參數數組,無需改動
     $para_token = array("service" => "alipay.wap.trade.create.direct", "partner" => trim($alipay_config['partner']), "sec_id" => trim($alipay_config['sign_type']), "format" => $format, "v" => $v, "req_id" => $req_id, "req_data" => $req_data, "_input_charset" => trim(strtolower($alipay_config['input_charset'])));
     //建立請求
     $alipaySubmit = new AlipaySubmit($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($alipay_config['partner']), "sec_id" => trim($alipay_config['sign_type']), "format" => $format, "v" => $v, "req_id" => $req_id, "req_data" => $req_data, "_input_charset" => trim(strtolower($alipay_config['input_charset'])));
     //建立請求
     $alipaySubmit = new AlipaySubmit($alipay_config);
     $html_text = $alipaySubmit->buildRequestForm($parameter, 'get', '確認');
     echo $html_text;
 }
開發者ID:zmou,項目名稱:service,代碼行數:65,代碼來源:Pay.class.php

示例15: index

    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'));
        }
        if (defined('MOBILE')) {
            //手機支付
            require_once CSCMSPATH . "pay/alipay_wap/alipay.config.php";
            require_once CSCMSPATH . "pay/alipay_wap/lib/alipay_submit.class.php";
            $format = "xml";
            $v = "2.0";
            $req_id = date('Ymdhis');
            $notify_url = site_url("pay/alipay/notify_url");
            $call_back_url = site_url("pay/alipay/return_url");
            $merchant_url = site_url("user/pay/lists");
            $seller_email = CS_Alipay_Name;
            $out_trade_no = $row->dingdan;
            $subject = L('pay_03', array($_SESSION['cscms__name']));
            $total_fee = $row->rmb;
            $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>';
            //構造要請求的參數數組,無需改動
            $para_token = array("service" => "alipay.wap.trade.create.direct", "partner" => trim($alipay_config['partner']), "sec_id" => trim($alipay_config['sign_type']), "format" => $format, "v" => $v, "req_id" => $req_id, "req_data" => $req_data, "_input_charset" => trim(strtolower($alipay_config['input_charset'])));
            //建立請求
            $alipaySubmit = new AlipaySubmit($alipay_config);
            $html_text = $alipaySubmit->buildRequestHttp($para_token);
            $html_text = urldecode($html_text);
            $para_html_text = $alipaySubmit->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($alipay_config['partner']), "sec_id" => trim($alipay_config['sign_type']), "format" => $format, "v" => $v, "req_id" => $req_id, "req_data" => $req_data, "_input_charset" => trim(strtolower($alipay_config['input_charset'])));
            //建立請求
            $alipaySubmit = new AlipaySubmit($alipay_config);
            $html_text = $alipaySubmit->buildRequestForm($parameter, 'get', L('pay_04'));
            echo $html_text;
        } elseif (CS_Alipay_JK == 1) {
            //雙功能
            require_once CSCMSPATH . "pay/alipay_trade/alipay.config.php";
            require_once CSCMSPATH . "pay/alipay_trade/lib/alipay_submit.class.php";
            $payment_type = "1";
            $notify_url = site_url("pay/alipay/notify_url");
            $return_url = site_url("pay/alipay/return_url");
            $seller_email = CS_Alipay_Name;
            $out_trade_no = $row->dingdan;
            $subject = L('pay_03', array($_SESSION['cscms__name']));
            $price = $row->rmb;
            $quantity = "1";
            $logistics_fee = "0.00";
            $logistics_type = "EXPRESS";
            $logistics_payment = "SELLER_PAY";
            $body = $subject;
            $show_url = '';
            $receive_name = '';
            $receive_address = '';
            $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", L('pay_02'));
            echo $html_text;
        } elseif (CS_Alipay_JK == 2) {
            //即時到賬
            require_once CSCMSPATH . "pay/alipay_direct/alipay.config.php";
            require_once CSCMSPATH . "pay/alipay_direct/lib/alipay_submit.class.php";
            $payment_type = "1";
            $notify_url = site_url("pay/alipay/notify_url");
            $return_url = site_url("pay/alipay/return_url");
            $seller_email = CS_Alipay_Name;
            $out_trade_no = $row->dingdan;
            $subject = L('pay_03', array($_SESSION['cscms__name']));
            $total_fee = $row->rmb;
            $body = $subject;
            $show_url = '';
            $anti_phishing_key = '';
            $exter_invoke_ip = '';
            //構造要請求的參數數組,無需改動
            $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'])));
            //建立請求
            $alipaySubmit = new AlipaySubmit($alipay_config);
            $html_text = $alipaySubmit->buildRequestForm($parameter, "get", L('pay_02'));
            echo $html_text;
        } else {
            //手動充值
            echo '
  				 <FORM accept-charset="gbk" action="https://shenghuo.alipay.com/send/payment/fill.htm" method="post" id="form1" name="form1" onsubmit="document.charset=\'gbk\';">
  				 <INPUT type="hidden" name="optEmail" value="' . CS_Alipay_Name . '">
  				 <INPUT type="hidden" name="payAmount" value="' . $row->rmb . '">
  				 <INPUT type="hidden" name="title" value="' . get_bm('utf-8', 'gbk', L('pay_03', array($_SESSION['cscms__name']))) . '">
  				 <INPUT type="hidden" name="memo" value="' . get_bm('utf-8', 'gbk', L('pay_05') . $_SESSION['cscms__name'] . L('pay_06') . $row->dingdan) . '">
  				 <script language="javascript">document.form1.submit();</script>
//.........這裏部分代碼省略.........
開發者ID:djqhuan,項目名稱:CSCMS-v4.0-UTF8,代碼行數:101,代碼來源:alipay.php


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