如下是运行微信支付测试代码时出错代码:
Warning: curl_setopt() expects parameter 2 to be long, string given in D:\wwwroot\weixinpaytest\pay\WxPay.JsApiPay.php on line 99
Fatal error: Uncaught exception ‘WxPayException‘ with message ‘curl出错,错误码:60‘ in D:\wwwroot\weixinpaytest\lib\WxPay.Api.php:564 Stack trace: #0 D:\wwwroot\weixinpaytest\lib\WxPay.Api.php(62):
WxPayApi::postXmlCurl(‘<xml><appid><![...‘, ‘https://api.mch...‘, false, 6) #1 D:\wwwroot\weixinpaytest\pay\jsapi.php(36):
WxPayApi::unifiedOrder(Object(WxPayUnifiedOrder)) #2 {main} thrown in D:\wwwroot\weixinpaytest\lib\WxPay.Api.php on line 564
第一个问题,这个问题完全是微信团队的问题,给出的example就是错的:
Warning: curl_setopt() expects parameter 2 to be long, string given in D:\wwwroot\weixinpaytest\pay\WxPay.JsApiPay.php on line 99
找到WxPay.JsApiPay.php文件的99行,curl_setopt($ch, CURLOP_TIMEOUT, 30);
微信团队example代码里少了一个“T”,正确代码应该是 curl_setopt($ch, CURLOPT_TIMEOUT, 30);
这样,这一个问题就解决了。
下面说第二个问题:
Fatal error: Uncaught exception ‘WxPayException‘ with message ‘curl出错,错误码:60‘ in D:\wwwroot\weixinpaytest\lib\WxPay.Api.php:564 Stack trace: #0D:\wwwroot\weixinpaytest\lib\WxPay.Api.php(62):
WxPayApi::postXmlCurl(‘<xml><appid><![...‘, ‘https://api.mch...‘, false, 6) #1 D:\wwwroot\weixinpaytest\pay\jsapi.php(36):
WxPayApi::unifiedOrder(Object(WxPayUnifiedOrder)) #2 {main} thrown in D:\wwwroot\weixinpaytest\lib\WxPay.Api.php on line 564
这个错误通过修改文件WxPay.Api.php 解决,具体如下:
第537行
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,TRUE);
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,2);//严格校验
to
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,FALSE);
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,FALSE);//严格校验2
这样,这两个问题就解决了!祝你好运!
以上就是对微信支付出现问题的资料整理,后续继续补充相关资料谢谢大家对本站的支持!
更新日志
- 名洋.1990-分手摆在胸口【天下唱片】【WAV+CUE】
- 罗大佑.2018-当年离家的年轻人巡回演唱会【大右音乐】【WAV+CUE】
- 姜育恒.1991-金曲精丫永声】【WAV+CUE】
- 水木年华.2010-启程【英皇星艺】【WAV+CUE】
- 邓丽君《漫步人生路》[DSF][1.3G]
- 林俊杰《学不会》[DSF][1.3G]
- 费玉清《Ultimate Sound》SACD 限量版[DSF][2G]
- 杨耀东.2002-经典金曲珍藏版2CD【东尼机构】【WAV+CUE】
- 新民樂演奏《春来人不来上海管弦楽團伴奏》[WAV+CUE].
- 玛吉阿米藏族民间歌舞艺术团-《仓央嘉措之歌》[ADMS][WAV+CUE]
- 王心凌《爱你》[FLAC][836M]
- 叶少菲《纯爱沉思录》[320K/MP3][120.43MB]
- 叶少菲《纯爱沉思录》[FLAC/分轨][330.3MB]
- 电子琴《汽车音响精品第三集第四集第五集》特效360度[WAV+CUE]
- 新民樂演奏《春来人不来上海管弦楽團伴奏》[WAV+CUE