以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- post xml 数据该怎么写 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=114612) |
-- 作者:bobolan521 -- 发布时间:2018/2/11 10:27:00 -- post xml 数据该怎么写 此主题相关图片如下:1c.jpg [此贴子已经被作者于2018/2/23 15:19:19编辑过]
|
-- 作者:有点蓝 -- 发布时间:2018/2/11 11:07:00 -- 请仔细核对官方的文档,很多必填的字段都没有 |
-- 作者:bobolan521 -- 发布时间:2018/2/11 12:05:00 -- [此贴子已经被作者于2018/2/11 13:03:58编辑过]
|
-- 作者:有点蓝 -- 发布时间:2018/2/11 12:20:00 -- 请问看文档了么?https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_1 必填为是的都需要
|
-- 作者:bobolan521 -- 发布时间:2018/2/11 13:04:00 -- 老师麻烦帮我看一下,我和官方的对比过来,还是不行,代码里的APPID,OPENID,spbill_create_ip,mch_id都用我真实的数据 [此贴子已经被作者于2018/2/11 13:15:19编辑过]
|
-- 作者:bobolan521 -- 发布时间:2018/2/11 13:11:00 -- [此贴子已经被作者于2018/2/11 16:25:38编辑过]
|
-- 作者:有点蓝 -- 发布时间:2018/2/11 14:21:00 -- Dim hc As New HttpClient("https://api.mch.weixin.qq.com/pay/unifiedorder") hc.Content = xml MessageBox.Show(hc.getdata) [此贴子已经被作者于2018/2/11 14:21:31编辑过]
|
-- 作者:bobolan521 -- 发布时间:2018/2/11 14:52:00 -- 麻烦老师了 [此贴子已经被作者于2018/2/11 16:22:40编辑过]
|
-- 作者:有点蓝 -- 发布时间:2018/2/11 15:23:00 -- Dim StringA,stringSignTemp,sign As String \'stringA ="appid=wxa7154bc4751eddec&body=test&device_info=1000&mch_id=1488726912&nonce_str=ibuaiVcKdpRxkhJA" \' stringSignTemp = stringA + "&key=hahaqwertyuioasdfghjklzxcvblanbo" Dim attach_my,body,getMCHID,notify_url,openid,out_trade_no,create_ip,getPartnerKey As String Dim st As New Date(1970,1,1,8,0,0) Dim getAppId As String = "wxa7154bc4751eddec" \'开发者ID Dim timestamp As Integer = CInt((Date.Now - st).TotalSeconds()) \'时间戳 Dim total_fee attach_my ="支付测试" body = "test" getMCHID ="1488726912" Dim nonce_str As String = Rand.NextString(16) \'随机字符 notify_url ="http://www.664748.top/hello.htm" openid = "ofRouwl_aRCGFTkhxeVECkQmzd8g" out_trade_no ="1415659990" create_ip="106.14.79.51" total_fee =1 getPartnerKey = "hahaqwertyuioasdfghjklzxcvblanbo" sign="appid=" & getAppId & "&attach=" & attach_my & "&body=" & body & "&mch_id=" & getMCHID & "&n¬ify_url=" & notify_url & "&openid=" & openid & "&out_trade_no=" & out_trade_no & "&spbill_create_ip=" & create_ip & "&total_fee=" & total_fee & "&trade_type=JSAPI&key=" & getPartnerKey Output.Show(sign) Dim md5 = System.Security.Cryptography.MD5.Create() Dim bs = md5.ComputeHash(Encoding.UTF8.GetBytes(sign)) Dim sb As new StringBuilder() For Each b As Byte In bs sb.Append(b.ToString("x2")) Next sign = sb.ToString().ToUpper() msgbox(sign) \'sign = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sign, "MD5") Dim xml As String Dim xo As New XObject xo.AddCDATA("appid",getAppId) xo.AddCDATA("attach",attach_my) xo.AddCDATA("body",body) xo.AddCDATA("mch_id",getMCHID ) xo.AddCDATA("nonce_str",nonce_str) xo.AddCDATA("notify_url",notify_url) xo.AddCDATA("openid",openid) xo.AddCDATA("out_trade_no",out_trade_no) xo.AddCDATA("spbill_create_ip",create_ip) xo.AddCDATA("total_fee",total_fee) xo.AddCDATA("trade_type","JSAPI") xo.AddCDATA("sign",sign) \'Dim hc As New HttpClient("https://api.mch.weixin.qq.com/pay/unifiedorder") \'hc.FormData.Add("xml",xo.ToXML) \'hc.C \'hc.Content = xo.ToXML \'MessageBox.Show(hc.getdata) \' Dim hc As New HttpClient("https://api.mch.weixin.qq.com/pay/unifiedorder") hc.Content = xo.ToXML MessageBox.Show(hc.getdata) |
-- 作者:bobolan521 -- 发布时间:2018/2/11 16:24:00 -- [此贴子已经被作者于2018/2/11 20:15:47编辑过]
|