同问
分账提交返回:基础连接已经关闭: 连接被意外关闭。是怎么回事?分账提交到 https://api.mch.weixin.qq.com/secapi/pay/profitsharing <xml> <mch_id>1459644502</mch_id> <nonce_str>82plnk7c5jdbl8e4f</nonce_str> <sign>017D838C8B6D8429BB381312E609D357AF8F38967DDB9A846244C320C258B918</sign> <sign_type>HMAC-SHA256</sign_type> <appid>wx12017585ce3b4d6b</appid> <transaction_id>4200000733202010173528706762</transaction_id> <out_order_no>B2010170855097102</out_order_no> <receivers>[{"type":"PERSONAL_OPENID","account":"osgIQ5ez0JDepZqjcVWL7qmzjLhY","amount":30,"description":"\u7528\u6237\u5206\u8D26"}]</receivers> </xml>
2021-04-20结贴:官方说的都是对的, 容易出错的点: 1.参数按照key=value的格式拼接,为str 2.HMACSHA256加密 生成sign 后转为大写,ps:Hmac_SHA256.GetHash(str.ToString(), mchkey)传参不要传错
微信公众号支付 HMACSHA256加密错误?支付签名一直错误,按照签名步骤校验:第一步 k = v 正确对照,第二步链接商户key也是对的,到第三步生成sign ( HMACSHA256加密)与校验签名工具得出的sign 不对照,不知道哪里出了问题,使用了很多种HMACSHA256加密代码: public static string GetHash(string message, string secret) { //第一种 secret = secret ?? ""; byte[] keyByte = Encoding.GetEncoding("UTF-8").GetBytes(secret); byte[] messageBytes = Encoding.GetEncoding("UTF-8").GetBytes(message); using (var hmacsha256 = new HMACSHA256(keyByte)) { byte[] hashmessage = hmacsha256.ComputeHash(messageBytes); string result = BitConverter.ToString(hashmessage); result = result.Replace("-", ""); return result.ToUpper(); } //第二种 //byte[] clearBytes = Encoding.UTF8.GetBytes(message); //byte[] keyByte = Encoding.UTF8.GetBytes(secret); //SHA256 sha256 = new SHA256Managed(); //sha256.ComputeHash(clearBytes); //byte[] hashedBytes = sha256.Hash; //sha256.Clear(); //string output = BitConverter.ToString(hashedBytes).Replace("-", ""); //return output.ToUpper(); //第三种 //string result = ""; //var enc = Encoding.Default; //byte[] //baText2BHashed = enc.GetBytes(message), //baSalt = enc.GetBytes(secret); //System.Security.Cryptography.HMACSHA256 hasher = new HMACSHA256(baSalt); //byte[] baHashedText = hasher.ComputeHash(baText2BHashed); //result = string.Join("", baHashedText.ToList().Select(b => b.ToString("x2")).ToArray()); //return result.ToUpper(); } 求各位大神看看,有什么不对的帮我解答一下。
2021-04-19想问问是怎么解决的
后台返回的小程序码base64怎么转换成图片,能让canvas的drawImage调用?想要在canvas里绘制带有参数的小程序码,但后台返回的是小程序码base64,不是https的地址,怎么能转换成https的地址让drawImage调用
2021-01-06服务器uploadFile合法域名也配置了
wx.uploadFile 上传图片在测试和开发者调试都可以,发布后 手机上上传图片一直失败https://developers.weixin.qq.com/miniprogram/dev/api/network/upload/wx.uploadFile.html
2020-12-30