服务器记录:
2020-12-30 15:06:20.1925
正常记录,进入了api_GetSandboxSignKey函数,顶部专设记录 ’进入函数api_GetSandboxSignKey报下一条错误
2020-12-30 15:06:20.3958
<!DOCTYPE HTML>
<html lang="zh-cn">
<head>
<meta charset="UTF-8"/>
<title>公益404</title>
</head>
<body>
<script type="text/javascript" src="//qzonestyle.gtimg.cn/qzone/hybrid/app/404/search_children.js" charset="utf-8"></script>
</body>
</html><!--[if !IE]>|xGv00|904eae036276b0335c391560dfbd5f16<![endif]-->
2020-12-30 15:06:20.3978
WxPayData签名存在但不合法1!
2020-12-30 15:06:20.4017
调用的目标发生了异常。
在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
在 System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
在 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
在 Foxtable.UserFunctions.Execute(String Name, Object[] Args)
WxPayData签名存在但不合法!
在 UserCode.WxPayData.FromXml(String xml)
在 UserCode.Aa2z4ibatiZsEpHWj(Object[] Args)
api_GetSandboxSignKey函数完整代码:
Functions.Execute("LogText","正常记录,进入了api_GetSandboxSignKey函数,顶部专设记录")
'获取支付验收验签秘钥API
Dim url As String = "https://api.mch.weixin.qq.com/sandboxnew/pay/getsignkey"
Dim req As new WxPayData
req.SetValue("mch_id", Vars("mchid"))
req.SetValue("nonce_str", req.GenerateNonceStr())'//随机字符串
req.SetValue("sign", req.MakeSign())'//签名
Dim hc As New HttpClient(url)
hc.C
hc.Timeout = 6
hc.Content = req.ToXML
Dim ret As String = hc.GetData()
Functions.Execute("logtext",ret)
Dim result As new WxPayData()
result.FromXml(ret)
If result.GetValue("return_code") = "FAIL"
Functions.Execute("logtext",result.GetValue("return_msg"))
'msgbox("获取支付验收验签秘钥API失败,原因: " & result.GetValue("return_msg"))
End If
Vars("test_key") = result.GetValue("sandbox_signkey")
'msgbox(Vars("test_key"))
Return result
上面,有的代码,看不见,专门存了,可以下载看
[此贴子已经被作者于2020/12/30 21:18:31编辑过]