$params = array(
'body' => '商品简单描述',
'out_trade_no' => '1217752501201407033233368018',
'total_fee' => 1,
'notify_url' => 'http://www.baidu.com',
'trade_type' => 'JSAPI',
'openid' => 'oYUwluMxtbO_tabXoEDNHIxxxx'
);
传递该参数能正常的返回数据,如下:
array (size=6)
'appid' => string 'wx3ec688f9222xxxd' (length=18)
'nonceStr' => string '3EMgh9Xk3R2sLjcy' (length=16)
'package' => string 'prepay_id=wx20150511014800d5e76c718c0217038858' (length=46)
'signType' => string 'MD5' (length=3)
'timeStamp' => int 1431280085
'paySign' => string '8FC35D2EB24D0D1780A169C0EE65AD30' (length=32)
在这种情况,在微信浏览器中打开我的测试页面会提示商户签名错误,如果我改变了body参数的值,比如将其换为good description,此时请求统一下单接口时,就不能获得prepay_id,结果如下:
array (size=6)
'appid' => string 'wx3ec688f9222bbd0d' (length=18)
'nonceStr' => string 'oatMrO1yGiDloKPM' (length=16)
'package' => string 'prepay_id=' (length=10) // 为空
'signType' => string 'MD5' (length=3)
'timeStamp' => int 1431280216
'paySign' => string 'B389D7CAA92FCA3887A3D75C41C40595' (length=32)
百度了好久,也没找到合适的解决方案,麻烦做过得帮忙看下。。。