/// <summary> /// 取消订单 /// </summary> /// <param name="orderId"></param> /// <returns></returns> public ActionResult CancelOrder(decimal orderId, int source = 0) { string actionName = "Index"; string controllerName = "H5ParkingPayment"; try { OnlineOrderServices.CancelOrder(orderId); } catch (Exception ex) { ExceptionsServices.AddExceptionToDbAndTxt("H5AliPayment_Error", string.Format("取消待支付订单失败 orderId:{0};AliPayUserId:{1}", orderId, GetAliPayUserId), ex, LogFrom.WeiXin); } return(PageAlert(actionName, controllerName, new { RemindUserContent = "取消成功" })); }
public ActionResult AsynCancelOrder(decimal orderId) { try { OnlineOrderServices.CancelOrder(orderId); return(Json(MyResult.Success())); } catch (MyException ex) { ExceptionsServices.AddExceptionToDbAndTxt("H5WeiXinPayment_Error", string.Format("支付超时或用户手动取消待支付订单失败 orderId:{0};", orderId), ex, LogFrom.WeiXin); return(Json(MyResult.Error(ex.Message))); } catch (Exception ex) { ExceptionsServices.AddExceptionToDbAndTxt("H5WeiXinPayment_Error", string.Format("支付超时或用户手动取消待支付订单失败 orderId:{0};", orderId), ex, LogFrom.WeiXin); return(Json(MyResult.Error("取消订单失败"))); } }
/// <summary> /// 取消订单 /// </summary> /// <param name="orderId"></param> /// <returns></returns> public ActionResult CancelOrder(decimal orderId, int source = 0) { string actionName = "Index"; string controllerName = "ParkingPayment"; try { OnlineOrder order = OnlineOrderServices.QueryByOrderId(orderId); if (order != null) { OnlineOrderServices.CancelOrder(orderId); if (order.OrderType == OnlineOrderType.MonthCardRecharge) { controllerName = "CardRenewal"; actionName = "Index"; } if (order.OrderType == OnlineOrderType.ParkFee) { if (source == 0) { controllerName = "ParkingPayment"; actionName = "Index"; } else { controllerName = "QRCodeParkPayment"; actionName = "Index"; } } if (order.OrderType == OnlineOrderType.PkBitBooking) { controllerName = "ParkBitBooking"; actionName = "Index"; } } } catch (Exception ex) { ExceptionsServices.AddExceptionToDbAndTxt("AliPay_Error", string.Format("取消待支付订单失败 orderId:{0};openId:{1}", orderId, WeiXinOpenId), ex, LogFrom.WeiXin); } return(PageAlert(actionName, controllerName, new { RemindUserContent = "取消成功" })); }