Closed wonleing closed 8 years ago
服务端代码里的 key 换成 live key 了吗?
换后显示的是invalid charge: no_charge_id
换了之后。charge 生成了吗?有抛异常吗?应该有错误信息的。
只在server的pay.php中改了live key,其它的哪都没动。改之前模拟付款是OK的,订单也能在管理平台看到。改之后就invalid charge: no_charge_id,连debug mode的那个alert都没显示。 异常错误信息在哪看?
模拟付款过了,表示你方法大致对了。live 模式要对,还得渠道参数也填正确。服务端你 charge 拿到了什么,输出来看看啊,可能会有报错,try catch 一下,看 example
你指的是$input_data吧 拿到的内容是:a:5:{s:7:"channel";s:6:"wx_pub";s:8:"order_no";s:12:"no1234567890";s:6:"amount";i:100;s:7:"open_id";s:28:"oUfxTtz-UjQZWvDJ2cjnWtSG03cE";s:3:"mid";s:8:"wonleing";} mid是我自己加的参数
server例子里这块要改吗? case 'wx_pub': $extra = array( 'open_id' => 'Openid' ); break;
需要把'Openid'改为拿到的'oUfxTtz-UjQZWvDJ2cjnWtSG03cE'吗
你这是什么……不是 json 啊,内容完全不对。只是你自己的请求参数啊
serialized的 格式没问题的。 'Openid'改为拿到的'oUfxTtz-UjQZWvDJ2cjnWtSG03cE'后果然有用。现在提示的是当前URL未注册了,估计是要在mp.weixin.qq.com中配置?
对的。需要设置授权目录。
在test环境下测试OK, 微信支付的渠道参数已经填写并打开LIVE环境。但实测时仍然弹出“模拟支付”的alert,点取消就什么也不发生,点确定则直接显示完成,订单出现在test环境下。 把手机微信帐号的open_id写死在client html中依然有这个问题。请问如何解决?