作者 郭鑫

微信支付调试

... ... @@ -34,21 +34,24 @@ class NotifyController extends HomeBaseController
$data = $base->FromXml($xml);
if($base->CheckSign() == true){
if ($data["return_code"] == "SUCCESS") {
$where['order_sn'] = $data['attach'];
$order_sn = $where['order_sn'] = $data['attach'];
if (!$where['order_sn']) {
$where['order_sn'] = $data['out_trade_no'];
}
// $where['money'] = $data['total_fee']/100;
$where['money'] = 1;
$order_model = new OrderModel();
$info = [
'pay_time'=>time(),
'status'=>2,
'transaction_id'=>$data['transaction_id']
];
$results = $order_model->where($where)->update($info);
if($results) {
$this->return_success();
$orderInfo = $order_model->where(['order_sn'=>$order_sn])->find();
if($orderInfo['status'] == 1) {
$info = [
'pay_time'=>time(),
'status'=>2,
'transaction_id'=>$data['transaction_id']
];
$results = $order_model->where($where)->update($info);
if($results) {
$this->return_success();
}
}
}
}
... ...