...
|
...
|
@@ -441,19 +441,45 @@ class OrderController extends HomeBaseController |
|
|
$out_trade_no = $arr['out_trade_no'];
|
|
|
$temp = explode('_', $out_trade_no);
|
|
|
$order_sn = $temp[0];
|
|
|
$oid = Db::name('order_info')->where(['order_sn' => $order_sn])->value('id');
|
|
|
$order = new OrderModel;
|
|
|
$order->orderCallBack($oid, $arr['total_amount']);
|
|
|
$info = Db::name('order_info')->field('id,order_amount')->where(['order_sn' => $order_sn])->find();
|
|
|
if($info['order_amount'] == $arr['total_amount']) {
|
|
|
$order = new OrderModel;
|
|
|
$order->orderCallBack($info['id'], $arr['total_amount']);
|
|
|
}else {
|
|
|
//严谨需要退款
|
|
|
}
|
|
|
} else {
|
|
|
//严谨需要退款
|
|
|
}
|
|
|
echo "success";
|
|
|
}else {
|
|
|
echo "fail";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//支付宝同步通知
|
|
|
//支付宝同步通知给用户跳转页面
|
|
|
public function alipayNotifys()
|
|
|
{
|
|
|
|
|
|
require EXTEND_PATH . '/alipay/config.php';
|
|
|
require_once EXTEND_PATH . '/alipay/wappay/service/AlipayTradeService.php';
|
|
|
$arr = request()->param();
|
|
|
$alipaySevice = new \AlipayTradeService($config);
|
|
|
$alipaySevice->writeLog(var_export($_POST, true));
|
|
|
$result = $alipaySevice->check($arr);
|
|
|
if ($result) {
|
|
|
if ($arr['trade_status'] == 'TRADE_SUCCESS') {
|
|
|
$out_trade_no = $arr['out_trade_no'];
|
|
|
$temp = explode('_', $out_trade_no);
|
|
|
$order_sn = $temp[0];
|
|
|
$oid = Db::name('order_info')->where(['order_sn' => $order_sn])->value('id');
|
|
|
$this->redirect(url('user/Center/orderDetail',['oid'=>$oid]));
|
|
|
} else {
|
|
|
//严谨需要退款
|
|
|
}
|
|
|
echo "success";
|
|
|
}else {
|
|
|
echo "fail";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|