public function getResponse($notify_id)
 {
     $transport = strtolower(trim($this->alipay_config["transport"]));
     $partner = trim($this->alipay_config["partner"]);
     $veryfy_url = "";
     if ($transport == "https") {
         $veryfy_url = $this->https_verify_url;
     } else {
         $veryfy_url = $this->http_verify_url;
     }
     $veryfy_url = $veryfy_url . "partner=" . $partner . "&notify_id=" . $notify_id;
     $responseTxt = getHttpResponseGET($veryfy_url, $this->alipay_config["cacert"]);
     return $responseTxt;
 }
 function getResponse($notify_id)
 {
     $transport = strtolower(trim($this->alipay_config['transport']));
     $partner = trim($this->alipay_config['partner']);
     $veryfy_url = '';
     if ($transport == 'https') {
         $veryfy_url = $this->https_verify_url;
     } else {
         $veryfy_url = $this->http_verify_url;
     }
     $veryfy_url = $veryfy_url . "partner=" . $partner . "&notify_id=" . $notify_id;
     $responseTxt = getHttpResponseGET($veryfy_url, $this->alipay_config['cacert']);
     return $responseTxt;
 }
Beispiel #3
0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>WHMCS - 支付宝接口测试</title>
</head>
<body>

<?php 
require_once "./alipay.class.php";
$cafile = "./cacert.pem";
$url = "http://notify.alipay.com/trade/notify_query.do?service=notify_verify&partner=2088002560&notify_id=RqP";
$return = getHttpResponseGET($url, $cafile);
$ok = strstr($return, 'false') ? "成功" : "失败";
echo "测试CURL连接HTTP  :{$ok}";
$url = "https://mapi.alipay.com/gateway.do?service=notify_verify&service=notify_verify&partner=2088002560&notify_id=RqP";
$return = getHttpResponseGET($url, $cafile);
$ok = strstr($return, 'PARTNER') ? "成功" : "失败";
echo "\r\n<br>测试CURL连接HTTPS  :{$ok}";
Beispiel #4
0
	/**
     * 用于防钓鱼,调用接口query_timestamp来获取时间戳的处理函数
	 * 注意:该功能PHP5环境及以上支持,因此必须服务器、本地电脑中装有支持DOMDocument、SSL的PHP配置环境。建议本地调试时使用PHP开发软件
     * return 时间戳字符串
	 */
	function query_timestamp() {
		$url = $this->alipay_gateway_new."service=query_timestamp&partner=".trim(strtolower($this->alipay_config['partner']))."&_input_charset=".trim(strtolower($this->alipay_config['input_charset']));
		$encrypt_key = "";
		$responseTxt = getHttpResponseGET($url,$this->alipay_config['cacert']);
		preg_match("/<encrypt_key>(.+)<\/encrypt_key>/i",$responseTxt,$arr);
		return $arr[1];
		/*
		$doc = new DOMDocument();
		$doc->load($url);
		$itemEncrypt_key = $doc->getElementsByTagName( "encrypt_key" );
		$encrypt_key = $itemEncrypt_key->item(0)->nodeValue;
		
		return $encrypt_key;
		*/
	}
Beispiel #5
0
 /**
  * 获取远程服务器ATN结果,验证返回URL
  * @param $notify_id 通知校验ID
  * @return 服务器ATN结果
  * 验证结果集:
  * invalid命令参数不对 出现这个错误,请检测返回处理中partner和key是否为空 
  * true 返回正确信息
  * false 请检查防火墙或者是服务器阻止端口问题以及验证时间是否超过一分钟
  */
 function getResponse($notify_id)
 {
     $transport = strtolower(trim($this->alipay_config['transport']));
     $partner = trim($this->alipay_config['partner']);
     $veryfy_url = '';
     if ($transport == 'https') {
         $veryfy_url = $this->https_verify_url;
     } else {
         $veryfy_url = $this->http_verify_url;
     }
     $veryfy_url = $veryfy_url . "partner=" . $partner . "&notify_id=" . $notify_id;
     $verify_url = htmlspecialchars($veryfy_url);
     $responseTxt = getHttpResponseGET($veryfy_url, $this->alipay_config['cacert']);
     //$responseTxt = getHttpResponseGET($veryfy_url,"/var/www/heimiBootstrap/index/Conf/cacert.pem");
     return $responseTxt;
 }
Beispiel #6
0
 /**
  * 获取远程服务器ATN结果,验证返回URL
  * @param $notify_id 通知校验ID
  * @return 服务器ATN结果
  * 验证结果集:
  * invalid命令参数不对 出现这个错误,请检测返回处理中partner和key是否为空 
  * true 返回正确信息
  * false 请检查防火墙或者是服务器阻止端口问题以及验证时间是否超过一分钟
  */
 function getResponse($notify_id)
 {
     $partner = trim($this->alipay_config['partner']);
     $veryfy_url = '';
     if (extension_loaded('openssl')) {
         $veryfy_url = $this->https_verify_url;
     } else {
         $veryfy_url = $this->http_verify_url;
     }
     $veryfy_url = $veryfy_url . "partner=" . $partner . "&notify_id=" . $notify_id;
     $responseTxt = getHttpResponseGET($veryfy_url, getcwd() . '/cacert.pem');
     return $responseTxt;
 }
 /**
  * 获取远程服务器ATN结果,验证返回URL
  * @param $notify_id 通知校验ID
  * @return 服务器ATN结果
  * 验证结果集:
  * invalid命令参数不对 出现这个错误,请检测返回处理中partner和key是否为空
  * true 返回正确信息
  * false 请检查防火墙或者是服务器阻止端口问题以及验证时间是否超过一分钟
  */
 function getResponse($notify_id)
 {
     $transport = strtolower(trim($this->alipay_config['transport']));
     $partner = trim($this->alipay_config['partner']);
     $veryfy_url = '';
     if ($transport == 'https') {
         $veryfy_url = $this->https_verify_url;
     } else {
         $veryfy_url = $this->http_verify_url;
     }
     echo 'veryfy_url=' . $veryfy_url . 'partner=' . $partner . '&notify_id=' . $notify_id . '<br>';
     $veryfy_url = $veryfy_url . 'partner=' . $partner . '&notify_id=' . $notify_id;
     $responseTxt = getHttpResponseGET($veryfy_url, $this->alipay_config['cacert']);
     echo $this->alipay_config['cacert'];
     echo '$responseTxt-=' . $responseTxt . '<br>';
     return $responseTxt;
 }