根据接口的参数,返回的信息验签失败,这个是什么原因,怎么解决呢
array(3) { ["code"]=> string(10) "SIGN_ERROR" ["detail"]=> array(4) { ["detail"]=> array(1) { ["issue"]=> string(14) "sign not match" } ["field"]=> string(9) "signature" ["location"]=> string(13) "authorization" ["sign_information"]=> array(4) { ["method"]=> string(4) "POST" ["sign_message_length"]=> int(347) ["truncated_sign_message"]=> string(83) "POST /v3/profitsharing/orders 1717411225 cbqHWbCQwe2OYXyHfacrfzRsDlIA52Ep {"appid" " ["url"]=> string(24) "/v3/profitsharing/orders" } } ["message"]=> string(30) "错误的签名,验签失败" }
排查指引错误根据文档排查下先:https://developers.weixin.qq.com/community/develop/article/doc/0004eae4f94c981f6c101ba7e6d813配合签名验证工具https://pay.weixin.qq.com/docs/merchant/sdk-tools/signature-verification-tool.html进行排查一下
如果有使用sdk的话 会自动签名验签。签名错误的话 检查下对应的参数。注意商户号和商户api证书对应。
建议直接用sdkhttps://pay.weixin.qq.com/wiki/doc/apiv3/wechatpay/wechatpay6_0.shtml