安卓手机使用微信支付H5Pay提示:商家参数格式有误,请联系商家解决
// 在H5项目中发起支付时 https://wx.tenpay.com/cgi-bin/mmpayweb-bin/checkmweb //一般可使用 但会导致 在 android WebView 中丢失referer <script type="text/javascript"> window.location.href="https://wx.tenpay.com/cgi-bin/mmpayweb-bin/checkmweb?支付信息"; </script>
下面两种方式 android WebView 中不会丢失referer
<body> <form name="form"> </form> </body> <scrip> document.form.method= "post"; document.form.action= "https://wx.tenpay.com/cgi-bin/mmpayweb-bin/checkmweb?支付信息 "; document.form.submit(); </scrip>
jQuery动态创建form表单提交
var action='https://wx.tenpay.com/cgi-bin/mmpayweb-bin/checkmweb?支付信息 ' var form = $("<form></form>") form.attr('action', action) form.attr('method', 'post') //追加到body,不显示,然后提交 form.appendTo("body") form.css('display', 'none') form.submit()