wx pay debug
parent
9657937fd7
commit
15f438fa7a
|
|
@ -611,6 +611,38 @@ class Weixin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* [Curl_Post curl模拟post]
|
||||||
|
* @param [string] $url [请求地址]
|
||||||
|
* @param [array] $post [发送的post数据]
|
||||||
|
* @param [boolean] $use_cert [是否需要使用证书]
|
||||||
|
*/
|
||||||
|
private function HttpRequest($url, $post, $use_cert = false)
|
||||||
|
{
|
||||||
|
$options = array(
|
||||||
|
CURLOPT_RETURNTRANSFER => true,
|
||||||
|
CURLOPT_HEADER => false,
|
||||||
|
CURLOPT_POST => true,
|
||||||
|
CURLOPT_POSTFIELDS => $post,
|
||||||
|
);
|
||||||
|
|
||||||
|
if($use_cert == true)
|
||||||
|
{
|
||||||
|
//设置证书
|
||||||
|
//使用证书:cert 与 key 分别属于两个.pem文件
|
||||||
|
$options[CURLOPT_SSLCERTTYPE] = 'PEM';
|
||||||
|
$options[CURLOPT_SSLCERT] = ROOT.'cert/apiclient_cert.pem';
|
||||||
|
$options[CURLOPT_SSLKEYTYPE] = 'PEM';
|
||||||
|
$options[CURLOPT_SSLKEY] = ROOT.'cert/apiclient_key.pem';
|
||||||
|
}
|
||||||
|
|
||||||
|
$ch = curl_init($url);
|
||||||
|
curl_setopt_array($ch, $options);
|
||||||
|
$result = curl_exec($ch);
|
||||||
|
curl_close($ch);
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 以post方式提交xml到对应的接口url
|
* 以post方式提交xml到对应的接口url
|
||||||
*
|
*
|
||||||
|
|
@ -621,7 +653,7 @@ class Weixin
|
||||||
* @param int $second url执行超时时间,默认30s
|
* @param int $second url执行超时时间,默认30s
|
||||||
* @throws WxPayException
|
* @throws WxPayException
|
||||||
*/
|
*/
|
||||||
private static function HttpRequest($url, $xml, $useCert = false, $second = 30)
|
private static function HttpRequesthh($url, $xml, $useCert = false, $second = 30)
|
||||||
{
|
{
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
$curlVersion = curl_version();
|
$curlVersion = curl_version();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue