本文整理汇总了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;
}
}
示例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 ();
}
}
示例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;
}
}
示例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);
}
示例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;