使用PHP版的SDK,沒處理好,發現有test/TestImage.php的測試文件,開始改,發現狀態碼$request -> getCode()一直為0,一路調試上去,發現是getContents函數裡curl錯誤!輸出curl_errno($ch),SSL certificate problem: unable to get local issuer certificate 使用解決方法是憑證問題。
錯誤代碼invalid-method 錯誤原因: 不存在的方法名稱一直未解決,可能是$request應該是文件中的AlipayCommerceCityfacilitatorVoucherGenerateRequest或測試檔中的類別實例或測試檔中的$liContsientrateRequest或測試檔中的(AlipayMobilePublicMultiMediaExecute實例)還有Warning: openssl_sign(): supplied key param cannot be coerced into a private supplied key param cannot be coerced into a private supplied key param cannot be coerced into a private supplied 發現頁有問題,又有回顧吼吼吼。
配置好之後有錯誤{"code":"40006","msg":"Insufficient Permissions","sub_code":"isv.insufficient-isv-permissions","sub_msg":"ISV權限不足"}
換了沙箱帳號,提醒另一個錯誤{"code":"40004","msg":"Business Failed","sub_code":"unknown-sub-code","sub_msg":"未知的錯誤碼"},但都是驗簽函數checkResponseSign()內出錯。
object(SignData)[5] public 'signSourceData' => string '{"code":"40004","msg":"Business Failed","sub_code":"unknown-sub-code","sub_msg":"未知的错误码"}' (length=101) public 'sign' => string 'EfXcLt1HDYQFHnfJRy31/S9+AeCd7J4jw/Zrphi2ImHgCIBGIbyZ8+Ch2yoiGeKN/tqdTPSEOosEI9QF1Nx53fHKHZG1SkrodwVzSSdkVPM9pxCszCn4u0ktTi925BazTFfNoq****JTHflEJ91GOhX19sbFYSnvD6RWus4YeFo=' (length=172)
上面加重的【×tamp=】很疑惑啊,×怎麼可以在裡面,前面應該query就結束了然後應該是時間參數×tamp這個啊,改成×tamp=就至少可以回了而不是這個錯誤:錯誤碼invalid-method 錯誤原因: 不存在的方法名了。看看哪裡構造url出錯的。
array (size=15) 'app_id' => string '2016091000478468' (length=16) 'version' => string '1.0' (length=3) 'format' => string 'json' (length=4) 'sign_type' => string 'RSA' (length=3) 'method' => string 'alipay.commerce.cityfacilitator.station.query' (length=45) 'timestamp' => string '2016-10-27 08:48:32' (length=19) 'auth_token' => null 'alipay_sdk' => string 'alipay-sdk-php-20160411' (length=23) 'terminal_type' => null 'terminal_info' => null 'prod_code' => null 'notify_url' => null 'charset' => string 'UTF-8' (length=5) 'app_auth_token' => null 'sign' => string 'f6ufUiSHCb7LNaXJvTdPEdDzfxKgepILJiKaM3wqueGojpOTZrVFRhVFqAQAxCEze9bVX77fpS/bvT8IVoD+/DMikZrje8SqkrSQvIHG8r1VhucgWplpgJU7HzViE*****************/MoG5OqfPf+H+rU+Eui7+bfYXtTDY=' (length=172)
×的html轉義字符就是×
,所以 echo "×tamp=";會輸出×tamp這種么蛾。
<span style="font-size: 15px">foreach ($sysParams as $sysParamKey => $sysParamValue) {
$requestUrl .= "$sysParamKey=" . urlencode($this->characet($sysParamValue, $this->postCharset)) . "&<span style="color: #ff00ff">amp;</span>";
}</span>
然而,頁面什麼也沒有,錯誤也沒有,空白,空。繼續調
https://support.open.alipay.com/support/myQuestionDetail.htm?id=266419 沒頭緒提了問題回答也沒頭緒。10/28
昨天遇到的參數問題,我把timestamp提到了最前面,發現時間參數還差了6個小時,不說了直接time()+6*3600。然後[簽名無效]。求救~