json参数不能格式化,要写在一起(不能有空格、换行符等)
签名错误,请检查后再试 是怎么回事儿?https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_5_1.shtml 小程序支付 使用jsapi下单接口获取prepay_id 签名生成 https://pay.weixin.qq.com/wiki/doc/apiv3/wechatpay/wechatpay4_0.shtml 按照这上面操作一直提示签名错误 [图片] 但是验签可以通过,官方给出的几个常见错误里也没有能解决的,完全不知道哪里出问题了,这个怎么定位问题?
06-19你好 Authorization 这个请求头如何设置成WECHATPAY2-SHA256-RSA2048呢? 我的直接报错: "Http头Authorization值格式错误,请参考《微信支付商户REST API签名规则》"
用postman测试小程序支付 报这个错 真离谱 有没有大佬告知一下?[图片]
06-18dynamic param = new { "mchid": "1900006XXX", "out_trade_no": "1217752501201407033233368318", "appid": "wxdace645e0bc2cXXX", "description": "Image形象店-深圳腾大-QQ公仔", "notify_url": "https://www.weixin.qq.com/wxpay/pay.php", "amount": { "total": 1, "currency": "CNY" }, "payer": { "openid": "o4GgauInH_RCEdvrrNGrntXDuXXX" } }; string method = "POST", uri = "/v3/pay/transactions/jsapi", _timeStamp = getTimeStamp(),_nonce_str = get_nonce_str(),body = JsonHelper.SerializeObject(param); string message = $"{method}\n{uri}\n{_timeStamp}\n{_nonce_str}\n{body}\n"; // 使用RSA进行签名 string _signature = ComputeSha256Hash(message, _mch_private_key); string authrizationValue = $"mchid=\"{_mch_id}\",nonce_str=\"{_nonce_str}\",timestamp=\"{_timeStamp}\",serial_no=\"{_serial_no}\",signature=\"{_signature}\""; HttpRequestMessage httpRequest = new HttpRequestMessage(HttpMethod.Post, jsapi_v3_Url); httpRequest.Content = new StringContent(body, Encoding.UTF8, "application/json"); httpRequest.Headers.Add("Accept", "application/json"); httpRequest.Headers.Add("ContentType", "application/json"); httpRequest.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("WECHATPAY2-SHA256-RSA2048", authrizationValue); using (HttpClient httpClient = new HttpClient()) { HttpResponseMessage response = await httpClient.SendAsync(httpRequest); //这里就一直没反应,也不报错 $$_$$! string responseString = await response.Content.ReadAsStringAsync(); }
JSAPI v3 小程序支付功能 ,获取预支付id失败,notify_url 这个参数没有具体说明产品:JSAPI v3 小程序支付功能 接口:JSAPI下单 参考官方文档:https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_5_1.shtml 请求URL:https://api.mch.weixin.qq.com/v3/pay/transactions/jsapi --------------------------------------------------------------------------------------------------------------------------------------------------------- 问题:直接在postman上调用时报错:Http头Authorization值格式错误,请参考《微信支付商户REST API签名规则》 帮忙看看请求参数或方法哪里调用错了?notify_url 这个参数要满足哪些要求(文档中并没有描述清楚),是不是这个参数有问题呢 [图片]
06-17