微信支付JS各種除錯問題

2022-05-04 11:51:07 字數 1050 閱讀 8794

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); 

這樣,這乙個問題就解決了

atal 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::unifiedorder(object(wxpayunifiedorder)) #2 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);//嚴格校驗

改:curl_setopt($ch,curlopt_ssl_verifypeer,false);

curl_setopt($ch,curlopt_ssl_verifyhost,false);//嚴格校驗2

問題出在網頁端調起支付api介面中timestamp引數,必須是string型別,但是php預設生成的時間戳是int型別。

解決方法就是修改下 lib/wxpay.data.php約2731行處settimestamp方法,修改為$this->values['timestamp'] = (string)$value;

三、   

微信js支付

你的js調起支付檔案是wcjspay.php,其目錄是www.domain.com wchat pay wcjspay.php那麼js介面安全網域名稱就要為 設定網頁授權目錄這個只需為你的 根目錄即可。開戶郵箱中有 接下來就是接入支付了下面是php源 1.這是調起js支付的 檔案 wcjspay.p...

js 除錯問題

06.this index 失效 使用的庫函式jquery 版本過低,1.4以上即可 05.載入後再載入相應的js 01.load function document.getelementbyid onload function 04.ie7 json不相容 g.util.parse2.url 1....

js呼叫微信支付

if typeof weixinjsbridge undefined else if document.attachevent else這段判斷,此時weixinjsbridge 未初始化完成,故值為undefined 走if語句,此時的onbridgeready方法沒有要求傳引數,故取不到data...