当前位置: 首页>>代码示例>>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;未经允许,请勿转载。