当前位置: 首页>>代码示例>>PHP>>正文


PHP HttpRequest::getRequest方法代码示例

本文整理汇总了PHP中HttpRequest::getRequest方法的典型用法代码示例。如果您正苦于以下问题:PHP HttpRequest::getRequest方法的具体用法?PHP HttpRequest::getRequest怎么用?PHP HttpRequest::getRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HttpRequest的用法示例。


在下文中一共展示了HttpRequest::getRequest方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: api

 public function api()
 {
     require_once FUWU_PATH . 'aop/AopClient.php';
     require_once FUWU_PATH . 'HttpRequst.php';
     $serviceType = HttpRequest::getRequest('service');
     $biz_content = HttpRequest::getRequest('biz_content');
     switch ($serviceType) {
         case 'alipay.service.check':
             $success = '<success>true</success>';
             $biz_content = '<biz_content>MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDVwtjFJVYyf4/sZY+GE3FSeLx7RyOmt+KoWnLi9XsRpQdaXRd+X7mO8kr8Yw6KN9TwgZV8o7iVi3OsuuCD/hgua4Go2oyIWG/NjcaqM3nXOYripfV+BlOdslKBVyAhY6SNuavLt97CVpAe2bIcZH/heNQnHoMQtb/X+KoC6kwouQIDAQAB</biz_content>';
             $tmpArr = array($biz_content, $success);
             $aop = new AopClient();
             $sign = $aop->rsaSign($tmpArr);
             $xmlTmp = '<?xml version="1.0" encoding="GBK"?><alipay><response><success>true</success>' . $biz_content . '</response><sign>' . $sign . '</sign><sign_type>RSA</sign_type></alipay>';
             echo $xmlTmp;
             break;
         case 'alipay.mobile.public.message.notify':
             require_once FUWU_PATH . 'Message.php';
             $post = file_get_contents('php://input');
             $str = urldecode($post);
             $arr = explode('&', $str);
             $arr = explode('=', $arr[1]);
             $msg = new Message($arr[1], $this->FuwuToken);
             break;
     }
 }
开发者ID:liuguogen,项目名称:weixin,代码行数:26,代码来源:FuwuAction.class.php

示例2: verifygw

	public function verifygw() {
		$biz_content = HttpRequest::getRequest ( "biz_content" );
		$as = new AlipaySign ();
		$xml = simplexml_load_string ( $biz_content );
		// print_r($xml);
		$EventType = ( string ) $xml->EventType;
		// echo $EventType;
		if ($EventType == "verifygw") {
			require 'config.php';
			// global $config;
			// print_r ( $config );
			$response_xml = "<success>true</success><biz_content>" . $as->getPublicKeyStr($config ['merchant_public_key_file']) . "</biz_content>";
			// echo $response_xml;
			$return_xml = $as->sign_response ( $response_xml, $config ['charset'], $config ['merchant_private_key_file'] );
			file_put_contents ( "log.txt", $return_xml, FILE_APPEND );
			echo $return_xml;
			exit ();
		}
	}
开发者ID:kevicki,项目名称:pig,代码行数:19,代码来源:Gateway.php

示例3: verifygw

 public function verifygw($is_sign_success, $merchant_public_key_file, $merchant_private_key_file, $charset)
 {
     $biz_content = HttpRequest::getRequest("biz_content");
     $as = new AlipaySign();
     $xml = simplexml_load_string($biz_content);
     // print_r($xml);
     $EventType = (string) $xml->EventType;
     // echo $EventType;
     if ($EventType == "verifygw") {
         if ($is_sign_success) {
             $response_xml = "<success>true</success><biz_content>" . $as->getPublicKeyStr($merchant_public_key_file) . "</biz_content>";
         } else {
             // echo $response_xml;
             $response_xml = "<success>false</success><error_code>VERIFY_FAILED</error_code><biz_content>" . $as->getPublicKeyStr($merchant_public_key_file) . "</biz_content>";
         }
         $return_xml = $as->sign_response($response_xml, $charset, $merchant_private_key_file);
         writeLog("response_xml: " . $return_xml);
         echo $return_xml;
         exit;
     }
 }
开发者ID:tiantuikeji,项目名称:fy,代码行数:21,代码来源:common.php

示例4: AlipaySign

$sign_type = HttpRequest::getRequest ( "sign_type" );
$biz_content = HttpRequest::getRequest ( "biz_content" );
$service = HttpRequest::getRequest ( "service" );
$charset = HttpRequest::getRequest ( "charset" );


if (empty($sign)||empty($sign_type)||empty($biz_content)||empty($service)||empty($charset)){
	echo "some parameter is empty.";
	exit();
}

//收到请求,先验证签名

$as = new AlipaySign ();
$sign_verify= $as->rsaCheckV2 ( $_REQUEST, $config ['alipay_public_key_file'] );
if (!$sign_verify){
	echo "sign verfiy fail.";
	exit();
}

//验证网关请求
if (HttpRequest::getRequest("service")=="alipay.service.check"){
// 	Gateway::verifygw();
	$gw=new Gateway();
	$gw->verifygw();
}else if (HttpRequest::getRequest("service")=="alipay.mobile.public.message.notify"){
	//处理收到的消息
	require_once 'Message.php';
	$msg=new Message($biz_content);
}
开发者ID:kevicki,项目名称:pig,代码行数:30,代码来源:index.php

示例5: AlipayMobilePublicFollowListRequest

//获取关注者列表
//https://fuwu.alipay.com/platform/doc.htm#c0501
if (HttpRequest::getRequest("param") == "follow") {
    $biz_content = "{\"nextUserId\":\"\"}";
    $request = new AlipayMobilePublicFollowListRequest();
    $request->setBizContent($biz_content);
    $result = aopclient_request_execute($request);
    // var_dump($result);
    if ($result != null && $result->alipay_mobile_public_follow_list_response->code == 200) {
        $list = $result->alipay_mobile_public_follow_list_response->data->user_id_list->string;
        print_r($list);
    }
}
//获取用户地理位置
//https://fuwu.alipay.com/platform/doc.htm#c0502
if (HttpRequest::getRequest("param") == "gis") {
    $userid = "BM7PjM8f8-v6VFqeTlFUqo97w0QKRHRl-OmymTOxsGHnKDWiwQekMHiEi06tEbjg01";
    $biz_content = "{\"userId\":\"{$userid}\"}";
    $request = new AlipayMobilePublicGisGetRequest();
    $request->setBizContent($biz_content);
    $result = aopclient_request_execute($request);
    // var_dump($result);
    if ($result != null && $result->alipay_mobile_public_gis_get_response->code == 200) {
        // 精确度
        $accuracy = $result->alipay_mobile_public_gis_get_response->accuracy;
        // 城市
        $city = $result->alipay_mobile_public_gis_get_response->city;
        // 纬度
        $latitude = $result->alipay_mobile_public_gis_get_response->latitude;
        // 经度
        $longitude = $result->alipay_mobile_public_gis_get_response->longitude;
开发者ID:tiantuikeji,项目名称:fy,代码行数:31,代码来源:index.php


注:本文中的HttpRequest::getRequest方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。