Micro-Credit Payment: Curl Error, error code: 602 Problem Solving _ related skills

Source: Internet
Author: User
Tags curl stack trace

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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.