按照easywechat文档一步步做下来下来,到了统一下单这一步:
$sheet = ....; //获取订单信息
//读取配置
$options = config('wechat');
$app = new Application($options);
$payment = $app->payment;
$attributes = [
'trade_type' => 'APP',
'body' => '商品',
'detail' => '',
'out_trade_no' => $sheet->sheetNumber,
'total_fee' => $sheet->payMoney
];
$order = new Order($attributes);
$result = $payment->prepare($order);
得到的$result一直是一个false,看wechat.log日志后API的响应是这个:
easywechat.DEBUG: API response: {"Status":200,"Reason":"OK","Headers":{"Server":["nginx"],"Date":["Mon, 10 Oct 2016 01:27:29 GMT"],"Content-Type":["text/html; charset=gbk"],"Content-Length":["0"],"Connection":["keep-alive"],"Keep-Alive":["timeout=8"],"Cache-Control":["no-cache, must-revalidate"]},"Body":""} []
此外便没有更多的信息或者是错误信息了,不知有没有遇到过这个问题的朋友?