request->post(); \Yii::error('通联支付回调:' . json_encode($params)); // if(isset($params['trxid'])){ // $trade = PaymentTrade::findOne(['third_trade_no' => $params['trxid']]); // }else{ $trade = PaymentTrade::findOne(['out_trade_no' => $params['cusorderid']]); // } if (!$trade) return true; if ($params['trxamt'] != bcmul($trade->pay_fee, 100, 0)) { throw new Exception('支付金额与订单金额不一致'); } $pay_service = new PayService($trade->mall_id); $res = $pay_service->notify($trade,$params); if ($res) { echo 'success'; } else { echo "erro"; } } public function actionQuery() { $out_trade_no = $this->request->get('out_trade_no'); $pay_service = new PayService(); $pay_service->query($out_trade_no); } }