The following is an error code when running a micro-letter payment test code:
Warning:curl_setopt () expects parameter 2 to is long, string given in D:\wwwroot\weixinpaytest\pay\WxPay.JsApiPay.php on Line 99
Fatal error:uncaught exception ' wxpayexception ' with message ' curl error, error code: M ' in D:\wwwroot\weixinpaytest\lib\ wxpay.api.php:564 Stack Trace: #0 D:\wwwroot\weixinpaytest\lib\WxPay.Api.php (62):
Wxpayapi::p ostxmlcurl (' <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
The first question, the question is entirely a matter of the micro-trust team, and the example is wrong:
Warning:curl_setopt () expects parameter 2 to is long, string given in D:\wwwroot\weixinpaytest\pay\WxPay.JsApiPay.php on Line 99
Find the 99 lines of the WxPay.JsApiPay.php file, curl_setopt ($ch, Curlop_timeout, 30);
Micro-Trust Team example code is missing a "T", the correct code should be curl_setopt ($ch, Curlopt_timeout, 30);
In this way, this problem is solved.
Here's a second question:
Fatal error:uncaught exception ' wxpayexception ' with message ' curl error, error code: M ' in D:\wwwroot\weixinpaytest\lib\ wxpay.api.php:564 Stack Trace: #0D:\wwwroot\weixinpaytest\lib\WxPay.Api.php (62):
Wxpayapi::p ostxmlcurl (' <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
This error is resolved by modifying the file WxPay.Api.php as follows:
Line No. 537
curl_setopt ($ch, curlopt_ssl_verifypeer,true);
curl_setopt ($ch, curlopt_ssl_verifyhost,2);//Strict check
To
curl_setopt ($ch, Curlopt_ssl_verifypeer,false);
curl_setopt ($ch, curlopt_ssl_verifyhost,false);//Strict Check 2
In this way, these two problems will be solved! Good luck!
The above is the issue of micro-letter payment data collation, follow-up to continue to supplement the relevant information thank you for your support of this site!