easywechat微信支付报错:invalid total_fee
原因和解决方法
原因: 测试用的$total_fee是0.01 报了这个错, 微信支付以分为单位 这里不能为小数,乘100再传入
解决: 0.01改为1
$attributes = [
'trade_type' => 'JSAPI',
'body' => '商品',
'out_trade_no' => $out_trade_no,
'total_fee' => $total_fee,
'openid' => $customer->openid
];
$result = $payment->order->unify($attributes);