...
|
...
|
@@ -533,6 +533,11 @@ class WxPayApi |
|
|
private static function postXmlCurl($xml, $url, $useCert = false, $second = 30)
|
|
|
{
|
|
|
$ch = curl_init();
|
|
|
//设置curl默认访问为IPv4
|
|
|
if (defined('CURLOPT_IPRESOLVE') && defined('CURL_IPRESOLVE_V4')) {
|
|
|
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
|
|
|
}
|
|
|
|
|
|
//设置超时
|
|
|
curl_setopt($ch, CURLOPT_TIMEOUT, $second);
|
|
|
|
...
|
...
|
@@ -548,7 +553,7 @@ class WxPayApi |
|
|
curl_setopt($ch, CURLOPT_HEADER, FALSE);
|
|
|
//要求结果为字符串且输出到屏幕上
|
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
|
|
|
|
|
|
|
|
if ($useCert == true) {
|
|
|
//设置证书
|
|
|
//使用证书:cert 与 key 分别属于两个.pem文件
|
...
|
...
|
|