private static bool VerifyExistTransferCallBack(string content) { bool exist = false; // 解析strXML为SendBuyMessage响应对象 SendPayMessage model = GetPayModelResponse(content); Hashtable htComm = GetCommonreturn(model.Commonreturn); string customerId = htComm["CustomerID"].ToString(); string userId = htComm["UserID"].ToString(); string seqNo = htComm["SeqNO"].ToString(); var loggingSessionInfo = Default.GetBSLoggingSession(customerId, userId); var resPayBll = new WXHouseReservationPayBLL(loggingSessionInfo); var resPayList = resPayBll.Query(new IWhereCondition[] { new EqualsCondition { DateTimeAccuracy = null, FieldName = "CustomerID", Value = customerId }, new EqualsCondition { DateTimeAccuracy = null, FieldName = "IsDelete", Value = "0" }, new EqualsCondition { DateTimeAccuracy = null, FieldName = "SeqNO", Value = seqNo } }, null); if (resPayList != null && resPayList.Length > 0) { exist = true; } return(exist); }
/// <summary> /// 支付(过户)。 /// </summary> /// <returns></returns> public static void TransferCallBack(string content) { Loggers.DEFAULT.Debug(new DebugLogInfo { Message = "支付(过户)" }); // 解析strXML为SendBuyMessage响应对象 SendPayMessage model = GetPayModelResponse(content); Hashtable htComm = GetCommonreturn(model.Commonreturn); string customerId = htComm["CustomerID"].ToString(); string userId = htComm["UserID"].ToString(); string prePaymentId = htComm["PrePaymentID"].ToString(); string seqNo = htComm["SeqNO"].ToString(); string merchantdate = htComm["Merchantdate"].ToString(); string resultPageUrl = htComm["ToPageURL"].ToString(); Loggers.DEFAULT.Debug(new DebugLogInfo { Message = "ToPageUrl" + resultPageUrl }); var loggingSessionInfo = Default.GetBSLoggingSession(customerId, userId); int fundState; //交易状态 string retMsg; //判断华安赎回返回Retcode状态 if (model.Retcode == "0000") { fundState = (int)PayHouseStateEnum.Order; retMsg = "委托已受理"; } else { fundState = (int)PayHouseStateEnum.Unsold; retMsg = "委托失败"; } #region 更新订单表中的证件号码 var orderBll = new WXHouseOrderBLL(loggingSessionInfo); WXHouseOrderEntity orderEntity = orderBll.GetByID(prePaymentId); if (orderEntity != null) { orderEntity.Assbuyeridno = model.Assbuyeridno; } orderBll.Update(orderEntity); #endregion #region 增加支付记录 var redeemBll = new WXHouseReservationPayBLL(loggingSessionInfo); WXHouseReservationPayEntity entity = redeemBll.GetByPrePaymentID(customerId, prePaymentId); if (entity != null) { entity.FundState = fundState; entity.HaorderNO = model.HaorderNO; redeemBll.Update(entity); } else { entity = new WXHouseReservationPayEntity { ReservationPayID = Guid.NewGuid(), PrePaymentID = new Guid(prePaymentId), SeqNO = seqNo, Fundtype = (int)FundtypeeEnum.ReservationPay, FundState = fundState, Merchantdate = merchantdate, HaorderNO = model.HaorderNO }; int haDt; int.TryParse(model.Hatradedt, out haDt); entity.Hatradedt = haDt; entity.Retmsg = model.Retmsg; entity.Retcode = model.Retcode; entity.CustomerID = customerId; redeemBll.Create(entity); } #endregion string toPageUrl = resultPageUrl + "&type=3&retStatus=" + fundState + "&retMsg=" + retMsg + "&Retcode=" + model.Retcode; RedirectUrl(toPageUrl); }