- 微信支付return_code为success,result为fail,求大神
请求的参数:<?xml version="1.0" encoding="UTF-8" standalone="no"?> <xml> <nonce_str>2710faff4b21493888b07d6f16941c94</nonce_str> <out_trade_no>1016</out_trade_no> <openid>oY5O15Ca4PaBNDcuLpZD0BCir_aA</openid> <appid>wxf4c34ff8a5ed2ce2</appid> <total_fee>1</total_fee> <sign>F378D404A8ED52A5E6D9B6835A0C8A6C</sign> <trade_type>JSAPI</trade_type> <mch_id>1537295961</mch_id> <body>舞蹈用品支付</body> notify_url>https://www.baidu.com/notify_url> <spbill_create_ip>39.107.77.243</spbill_create_ip> </xml> ----------微信返回结果-------:<xml><return_code><![CDATA[SUCCESS]]></return_code> <return_msg><![CDATA[OK]]></return_msg> <appid><![CDATA[wxf4c34ff8a5ed2ce2]]></appid> <mch_id><![CDATA[1537295961]]></mch_id> <nonce_str><![CDATA[rztyuKs6TlWPVGa2]]></nonce_str> <sign><![CDATA[296C5AF41F62151A424335E2FBBF4492]]></sign> <result_code><![CDATA[FAIL]]></result_code> <err_code><![CDATA[PARAM_ERROR]]></err_code> <err_code_des><![CDATA[appidåopenidä¸å¹é]]></err_code_des> </xml> 我特别奇怪的是既然return_code都success了,后面还给我来了个result_code fail ,err_code_des还乱码,搞了两天了,一直不知道问题所在,求大神解答,下面是我的后台代码: //统一下单接口参数 HashMap<String, String> param = new HashMap<String, String>(); param.put("appid", appid); param.put("mch_id", partner); param.put("nonce_str", nonce_str); param.put("body", body); //商户订单号 String out_trade_no= order.getOrderNo(); param.put("out_trade_no",out_trade_no); param.put("total_fee", String.valueOf(total_fee)); param.put("spbill_create_ip", spbill_create_ip); String notify_url = "https://www.baidu.com";//支付回調地址,把订单状态修改为已支付 param.put("notify_url", notify_url); param.put("trade_type","JSAPI"); param.put("openid", openid); String url = "https://api.mch.weixin.qq.com/pay/unifiedorder"; HttpClient client = new HttpClient(); client.getParams().setSoTimeout(300*1000); PostMethod myPost = new PostMethod(url); try{ String xmlParam = WXPayUtil.generateSignedXml(param, partnerkey); System.out.println("请求的参数:"+xmlParam); myPost.setRequestEntity(new StringRequestEntity(xmlParam,"text/xml","utf-8")); int status = client.executeMethod(myPost); if (status ==200){ String xmlResult = myPost.getResponseBodyAsString(); System.out.println("----------微信返回结果-------:"+xmlResult);
2019-06-03 - 微信支付return_code为success,result为fail,求大神
请求的参数:<?xml version="1.0" encoding="UTF-8" standalone="no"?> <xml> <nonce_str>2710faff4b21493888b07d6f16941c94</nonce_str> <out_trade_no>1016</out_trade_no> <openid>oY5O15Ca4PaBNDcuLpZD0BCir_aA</openid> <appid>wxf4c34ff8a5ed2ce2</appid> <total_fee>1</total_fee> <sign>F378D404A8ED52A5E6D9B6835A0C8A6C</sign> <trade_type>JSAPI</trade_type> <mch_id>1537295961</mch_id> <body>舞蹈用品支付</body> notify_url>https://www.baidu.com/notify_url> <spbill_create_ip>39.107.77.243</spbill_create_ip> </xml> ----------微信返回结果-------:<xml><return_code><![CDATA[SUCCESS]]></return_code> <return_msg><![CDATA[OK]]></return_msg> <appid><![CDATA[wxf4c34ff8a5ed2ce2]]></appid> <mch_id><![CDATA[1537295961]]></mch_id> <nonce_str><![CDATA[rztyuKs6TlWPVGa2]]></nonce_str> <sign><![CDATA[296C5AF41F62151A424335E2FBBF4492]]></sign> <result_code><![CDATA[FAIL]]></result_code> <err_code><![CDATA[PARAM_ERROR]]></err_code> <err_code_des><![CDATA[appidåopenidä¸å¹é]]></err_code_des> </xml> 我特别奇怪的是既然return_code都success了,后面还给我来了个result_code fail ,err_code_des还乱码,搞了两天了,一直不知道问题所在,求大神解答,下面是我的后台代码: //统一下单接口参数 HashMap<String, String> param = new HashMap<String, String>(); param.put("appid", appid); param.put("mch_id", partner); param.put("nonce_str", nonce_str); param.put("body", body); //商户订单号 String out_trade_no= order.getOrderNo(); param.put("out_trade_no",out_trade_no); param.put("total_fee", String.valueOf(total_fee)); param.put("spbill_create_ip", spbill_create_ip); String notify_url = "https://www.baidu.com";//支付回調地址,把订单状态修改为已支付 param.put("notify_url", notify_url); param.put("trade_type","JSAPI"); param.put("openid", openid); String url = "https://api.mch.weixin.qq.com/pay/unifiedorder"; HttpClient client = new HttpClient(); client.getParams().setSoTimeout(300*1000); PostMethod myPost = new PostMethod(url); try{ String xmlParam = WXPayUtil.generateSignedXml(param, partnerkey); System.out.println("请求的参数:"+xmlParam); myPost.setRequestEntity(new StringRequestEntity(xmlParam,"text/xml","utf-8")); int status = client.executeMethod(myPost); if (status ==200){ String xmlResult = myPost.getResponseBodyAsString(); System.out.println("----------微信返回结果-------:"+xmlResult);
2019-05-31 - api.weixin.qq.com 不在以下合法域名列表中
[图片] [图片] 如上图,我在获取openid的时候,报出这个错误,很奇怪,小程序访问自己的接口还需要配置request合法域名吗? 而且现在微信后台管理也不支持配置api.weixin.qq.com了
2017-06-15 - 如何再次获取openid
如题,我在微信里调用了api接口,第一次调用成功,给我返回了openid,然后我在程序里再次调用这个接口的时候,一直返回 {"errcode":40163,"errmsg":"code been used, hints: [ req_id: d1_Ila0989s194 ]"} 请教大神,如何用同一个微信号再次获取openid?
2017-06-14