为什么小程序支付成功后并且接受到微信的回调,但是回调里面没有微信的文档参数数据?
准备向小程序统一下单接口发出请求,参数详情为:{"body":"\u7f57\u8299\u52a0-\u62bd\u5956","out_trade_no":"1642564037327916","total_fee":1,"spbill_create_ip":"60.191.90.18","notify_url":"https:\/\/formal.lanchensh.com\/api\/wechat_pay_draw_notify","openid":"ozN0a40H-u_CwYTiaPivDGR4KVOs","appid":"wx156a24e1797fb40a","mch_id":"1603285437","nonce_str":"^J-#gDhRjO98S3-lky61-gmYC$IFM5K$","trade_type":"JSAPI","sign_type":"MD5","sign":"83F6A30AA8619239A397F5DDB711715D"}
微信小程序抽奖方法下单请求结束,返回的结果为:{"return_code":"SUCCESS","return_msg":"OK","result_code":"SUCCESS","mch_id":"1603285437","appid":"wx156a24e1797fb40a","nonce_str":"YJAyiSbA4fWFAS9a","sign":"BEE06958FEC8E350D1E0B8BACABC47DF","prepay_id":"wx1911471737354244d1574e33d071910000","trade_type":"JSAPI"}
微信小程序抽奖支付回调开始,接受参数如下:{"s":"\/\/api\/wechat_pay_draw_notify"}
已解决该问题。如果是使用PHP laravel框架的小伙伴,在回调控制器别用all()来获取所有参数,这样是获取不到的,因为all()是获取数据数组的,所以XML不符合接收类型,导致获取不到参数。推荐使用getContent()方法来接受。希望能给大家带来参考和帮助!