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


PHP AlipaySubmit::buildRequestHttp方法代碼示例

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


在下文中一共展示了AlipaySubmit::buildRequestHttp方法的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: send

 /**
  * @brief 開始向接口發送數據
  * @param $data array 訂單和配送數據
  */
 public function send($data)
 {
     require_once dirname(__FILE__) . "/lib/alipay_submit.class.php";
     /* if(isset($data['seller_id']) && $data['seller_id'] > 0 ){
     			//獲取商戶的支付配置信息
     			$sellPay = new IModel("seller_payment");
     			$sellers = $sellPay->getObj("seller_id = ".$data['seller_id']);
     			if(empty($sellers)){
     				return false;
     			}
     		} */
     $alipay_config = array('partner' => Payment::getConfigParam($data['pay_type'], 'M_PartnerId'), 'key' => Payment::getConfigParam($data['pay_type'], 'M_PartnerKey'), 'sign_type' => strtoupper('MD5'), 'input_charset' => strtolower('utf-8'), 'cacert' => getcwd() . '/cacert.pem', 'transport' => 'http');
     //支付寶交易號
     $trade_no = $data['trade_no'];
     //必填
     //物流公司名稱
     $logistics_name = $data['freight_type'];
     //必填
     //物流發貨單號
     $invoice_no = $data['delivery_code'];
     //物流運輸類型 三個值可選:POST(平郵)、EXPRESS(快遞)、EMS(EMS)
     $transport_type = 'EXPRESS';
     //構造要請求的參數數組,無需改動
     $parameter = array("service" => "send_goods_confirm_by_platform", "partner" => trim($alipay_config['partner']), "trade_no" => $trade_no, "logistics_name" => $logistics_name, "invoice_no" => $invoice_no, "transport_type" => $transport_type, "_input_charset" => trim(strtolower('utf-8')));
     //建立請求
     $alipaySubmit = new AlipaySubmit($alipay_config);
     $html_text = $alipaySubmit->buildRequestHttp($parameter);
 }
開發者ID:yongge666,項目名稱:sunupedu,代碼行數:32,代碼來源:sendgoods_platform_assure_alipay.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: send

 public function send($trade_no, $logistics_name, $invoice_no)
 {
     require_once "lib/alipay_submit.class.php";
     $alipaySubmit = new AlipaySubmit($this->config);
     $parameter = array("service" => "send_goods_confirm_by_platform", "partner" => trim($this->config['partner']), "trade_no" => $trade_no, "logistics_name" => $logistics_name, "invoice_no" => $invoice_no, "transport_type" => 'EXPRESS', "_input_charset" => trim(strtolower($alipay_config['input_charset'])));
     $html_text = $alipaySubmit->buildRequestHttp($parameter);
 }
開發者ID:sammychan1981,項目名稱:quanpin,代碼行數:7,代碼來源:AlipayDelivery.php

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

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

示例7: send

 public function send($post)
 {
     require_once "lib/alipay_submit.class.php";
     $parameter = array("service" => "send_goods_confirm_by_platform", "partner" => trim($this->alipay_config['partner']), "_input_charset" => trim(strtolower($this->alipay_config['input_charset'])), "trade_no" => $post['trade_no'], "logistics_name" => "無需物流", "invoice_no" => "", "transport_type" => "DIRECT", "create_transport_type" => "DIRECT", "seller_ip" => "");
     $this->alipay_config['cacert'] = $this->cacert;
     $alipaySubmit = new AlipaySubmit($this->alipay_config);
     $html_text = $alipaySubmit->buildRequestHttp($parameter);
     return $html_text;
 }
開發者ID:crab890715,項目名稱:GoOut-Panel,代碼行數:9,代碼來源:guarantee.php

示例8: buildRequestHttp

 public function buildRequestHttp($request)
 {
     $rs = $request->getParams();
     $parameter = array('partner' => $this->partner, '_input_charset' => $this->input_charset);
     $parameter = array_merge($parameter, $rs);
     //建立請求
     $alipaySubmit = new AlipaySubmit($this->alipay_config);
     $html_text = $alipaySubmit->buildRequestHttp($parameter);
     return $html_text;
 }
開發者ID:zwq,項目名稱:unpei,代碼行數:10,代碼來源:AlipayProxy.php

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

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

示例11: send

 /**
  * @brief 開始向接口發送數據
  * @param $data array 訂單和配送數據
  */
 public function send($data)
 {
     require_once dirname(__FILE__) . "/lib/alipay_submit.class.php";
     $alipay_config = array('partner' => $data['partner_id'], 'key' => $data['partner_key'], 'sign_type' => strtoupper('MD5'), 'input_charset' => strtolower('utf-8'), 'cacert' => getcwd() . '/cacert.pem', 'transport' => 'http');
     //支付寶交易號
     $trade_no = $data['trade_no'];
     //必填
     //物流公司名稱
     $logistics_name = $data['freight_type'];
     //必填
     //物流發貨單號
     $invoice_no = $data['delivery_code'];
     //物流運輸類型 三個值可選:POST(平郵)、EXPRESS(快遞)、EMS(EMS)
     $transport_type = 'EXPRESS';
     //構造要請求的參數數組,無需改動
     $parameter = array("service" => "send_goods_confirm_by_platform", "partner" => trim($alipay_config['partner']), "trade_no" => $trade_no, "logistics_name" => $logistics_name, "invoice_no" => $invoice_no, "transport_type" => $transport_type, "_input_charset" => trim(strtolower('utf-8')));
     //建立請求
     $alipaySubmit = new AlipaySubmit($alipay_config);
     $html_text = $alipaySubmit->buildRequestHttp($parameter);
 }
開發者ID:zhendeguoke1008,項目名稱:shop,代碼行數:24,代碼來源:sendgoods_alipay.php

示例12: startAlipay

 public function startAlipay()
 {
     $order_sn = $this->_get('order_sn');
     $token = $this->_get('token');
     Log::record($token . ':' . $order_sn);
     if (empty($order_sn) || empty($token)) {
         Log::record('startAlipay: ' . print_r($_GET, true));
         Log::save();
         $this->error('請輸入訂單號');
     }
     $order = M('b2c_order')->where(array('sn' => $order_sn, 'token' => $token, 'status' => 1))->find();
     if (!$order) {
         $this->error('訂單號不正確');
     }
     $shop = M('b2c_shop')->where(array('token' => $token))->find();
     if (!$shop) {
         $this->error('商城不存在');
     }
     $alipay = M('b2c_payment')->where(array('token' => $token, 'pay_code' => 'alipay'))->find();
     $alipay_config = array();
     if (is_string($alipay['pay_config'])) {
         $store = unserialize($alipay['pay_config']);
         $alipay_config['pay_account'] = $store['pay_account'];
         //合作身份者id,以2088開頭的16位純數字
         $alipay_config['partner'] = $store['alipay_pid'];
         //安全檢驗碼,以數字和字母組成的32位字符
         //如果簽名方式設置為“MD5”時,請設置該參數
         $alipay_config['key'] = $store['alipay_key'];
         //商戶的私鑰(後綴是.pen)文件相對路徑
         //如果簽名方式設置為“0001”時,請設置該參數
         //$alipay_config['private_key_path']  = getcwd()."/Conf/Wap/key/".$shop['token']."_rsa_private_key.pem";
         //支付寶公鑰(後綴是.pen)文件相對路徑
         //如果簽名方式設置為“0001”時,請設置該參數
         //$alipay_config['ali_public_key_path']= getcwd().'/Conf/Wap/key/'.$shop['token'].'_alipay_public_key.pem';
         //簽名方式 不需修改
         $alipay_config['sign_type'] = 'MD5';
         //'0001';
         //字符編碼格式 目前支持 gbk 或 utf-8
         $alipay_config['input_charset'] = 'utf-8';
         //ca證書路徑地址,用於curl中ssl校驗
         //請保證cacert.pem文件在當前文件夾目錄中
         $alipay_config['cacert'] = getcwd() . '\\Conf\\Wap\\key\\cacert.pem';
         //訪問模式,根據自己的服務器是否支持ssl訪問,若支持請選擇https;若不支持請選擇http
         $alipay_config['transport'] = 'http';
     }
     Log::record('alipay_config Args:' . print_r($alipay_config, true), Log::INFO);
     //返回格式
     $format = "xml";
     //必填,不需要修改
     //返回格式
     $v = "2.0";
     //必填,不需要修改
     //請求號
     $req_id = date('Ymdhis') . str_pad(mt_rand(1, 99999), 5, '0', STR_PAD_LEFT);
     //必填,須保證每次請求都是唯一
     //**req_data詳細信息**
     //服務器異步通知頁麵路徑
     $notify_url = C('site_url') . '/index.php/alipay/notify';
     //需http://格式的完整路徑,不能加?id=123這類自定義參數
     //頁麵跳轉同步通知頁麵路徑
     $call_back_url = C('site_url') . '/index.php/alipay/return_url';
     //需http://格式的完整路徑,不允許加?id=123這類自定義參數
     //操作中斷返回地址
     $merchant_url = "http://" . $shop['token'] . ".shop.weixinwz.com/";
     //用戶付款中途退出返回商戶的地址。需http://格式的完整路徑,不允許加?id=123這類自定義參數
     //賣家支付寶帳戶
     $seller_email = trim($alipay_config['pay_account']);
     //必填
     //商戶訂單號
     $out_trade_no = $order['sn'];
     //商戶網站訂單係統中唯一訂單號,必填
     //訂單名稱
     $subject = '訂單' . $order['sn'] . '支付';
     //必填
     //付款金額
     $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><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'])));
     Log::record('para_token Args:' . print_r($para_token, true), Log::INFO);
     $trade = M('b2c_trade')->where(array('order_sn' => $order_sn, 'token' => $shop['token']))->find();
     if ($trade == null) {
         $time = time();
         $data = array('subject' => $subject, 'name' => $order['truename'], 'order_sn' => $out_trade_no, 'price' => $total_fee);
         $data['create_time'] = $time;
         $data['update_time'] = $time;
         $data['token'] = $shop['token'];
         $ret = M('b2c_trade')->data($data)->add();
     } else {
         if ($trade['trade_no']) {
             $this->error('已支付');
         }
     }
     import("@.ORG.AliWapPay.AlipaySubmit");
     //建立請求
     $alipaySubmit = new AlipaySubmit($alipay_config);
     $html_text = $alipaySubmit->buildRequestHttp($para_token);
     //URLDECODE返回的信息
//.........這裏部分代碼省略.........
開發者ID:zhaoshengloveqingqing,項目名稱:Wechat,代碼行數:101,代碼來源:ShopPayAction.class.php

示例13: array

    //支付寶交易號
    $trade_no = $_POST['WIDtrade_no'];
    //必填
    //物流公司名稱
    $logistics_name = $_POST['WIDlogistics_name'];
    //必填
    //物流發貨單號
    $invoice_no = $_POST['WIDinvoice_no'];
    //物流運輸類型
    $transport_type = $_POST['WIDtransport_type'];
    //三個值可選:POST(平郵)、EXPRESS(快遞)、EMS(EMS)
    /************************************************************/
    //構造要請求的參數數組,無需改動
    $parameter = array("service" => "send_goods_confirm_by_platform", "partner" => trim($instance->config['partner']), "trade_no" => $trade_no, "logistics_name" => $logistics_name, "invoice_no" => $invoice_no, "transport_type" => $transport_type, "_input_charset" => trim(strtolower($instance->config['input_charset'])));
});
//建立請求
$alipaySubmit = new AlipaySubmit($pay->config);
$html_text = $alipaySubmit->buildRequestHttp($pay->param);
//解析XML
//注意:該功能PHP5環境及以上支持,需開通curl、SSL等PHP配置環境。建議本地調試時使用PHP開發軟件
$doc = new DOMDocument();
$doc->loadXML($html_text);
//請在這裏加上商戶的業務邏輯程序代碼
//——請根據您的業務邏輯來編寫程序(以下代碼僅作參考)——
//獲取支付寶的通知返回參數,可參考技術文檔中頁麵跳轉同步通知參數列表
//解析XML
if (!empty($doc->getElementsByTagName("alipay")->item(0)->nodeValue)) {
    $alipay = $doc->getElementsByTagName("alipay")->item(0)->nodeValue;
    echo $alipay;
}
//——請根據您的業務邏輯來編寫程序(以上代碼僅作參考)——
開發者ID:lunnlew,項目名稱:Norma_Code,代碼行數:31,代碼來源:alipayapi.php

示例14: array

//必填
//付款金額
$pay_price = $pay['total_fee'];
//商戶訂單號
$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);
開發者ID:myjavawork,項目名稱:sanxin-fangwei,代碼行數:31,代碼來源:alipayapi.php

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


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