微信支付生成预付单,获取prepay_id时,总是提示签名错误,包名、签名都在微信平台做了配置,有做过的高手吗。
List<NameValuePair> packageParams = new LinkedList<NameValuePair>();
List<NameValuePair> packageParams = new LinkedList<NameValuePair>();
packageParams.add(new BasicNameValuePair(“appid”, Constants.APP_ID));
packageParams.add(new BasicNameValuePair(“body”, “weixin”));
packageParams.add(new BasicNameValuePair(“mch_id”, Constants.MCH_ID));
packageParams.add(new BasicNameValuePair(“nonce_str”, nonceStr));
packageParams.add(new BasicNameValuePair(“notify_url”, “http://127.0.0.1/test”));
packageParams.add(new BasicNameValuePair(“out_trade_no”,getOutTradeNo()));
packageParams.add(new BasicNameValuePair(“spbill_create_ip”,”127.0.0.1″));
packageParams.add(new BasicNameValuePair(“total_fee”, “10”));
packageParams.add(new BasicNameValuePair(“trade_type”, “APP”));
返回值:
<xml><return_code><![CDATA[FAIL]]></return_code>
<return_msg><![CDATA[签名错误]]></return_msg>
</xml>
解决方案:20分