/// <summary> /// 提现,五万以上 /// </summary> /// <returns></returns> private BJUnionPayPaymentResponse LargeWithdraw(OrderPaidWithdraw orderPaidWithdraw) { BJUnionPayPaymentRequest request = new BJUnionPayPaymentRequest(); request.Head.ReqJnlNo = GuidHelper.GenUniqueId(); request.Body.CifClientId = orderPaidWithdraw.OrderPaid.Member.ClientId; request.Body.CoPatrnerJnlNo = orderPaidWithdraw.SerialNumber; request.Body.TrsDate = DateTime.Now.ToString("yyyyMMdd"); request.Body.Currency = "CNY"; request.Body.AcNo = orderPaidWithdraw.OrderPaid.Member.BankCardNumber; request.Body.PayeeName = orderPaidWithdraw.OrderPaid.Member.Name; request.Body.PayeeBankName = orderPaidWithdraw.OrderPaid.Member.BankCard.Bank.Name; request.Body.PayeeBankNo = orderPaidWithdraw.OrderPaid.Member.BankCard.Bank.CodeGuangDa; request.Body.AcType = "2"; request.Body.Amount = orderPaidWithdraw.Amount.ToString(); request.Body.TransferFee = "0"; request.Body.Remark = "提现"; request.Body.Reserve1 = ""; request.Body.Reserve2 = ""; request.Body.Reserve3 = ""; request.Body.Reserve4 = ""; request.Body.Reserve5 = ""; var result = guangDaExec.Exec(request) as BJUnionPayPaymentResponse; return(result); }
private void WithdrawFail(OrderPaidWithdraw orderPaidWithdraw) { var iOrderPaidWithdrawService = DIFactory.GetContainer().Resolve <IOrderPaidWithdrawService>(); orderPaidWithdraw.Status = OrderPaidWithdrawStatusOption.Fail.ToInt(); iOrderPaidWithdrawService.Save(orderPaidWithdraw); orderPaidWithdraw.OrderPaid.Status = OrderPaidStatusOption.UnFrozenSuccess.ToInt(); Save(orderPaidWithdraw.OrderPaid); }
public BaseResponse Withdraw(OrderPaidWithdraw orderPaidWithdraw) { if (orderPaidWithdraw.Amount < 50000) { return(SmallWithdraw(orderPaidWithdraw)); } else { return(LargeWithdraw(orderPaidWithdraw)); } }
private void Withdraw(OrderPaid orderPaid) { //var iOrderPaidService = DIFactory.GetContainer().Resolve<IOrderPaidService>(); var iGuangDaAPIService = DIFactory.GetContainer().Resolve <IGuangDaAPIService>(); var iOrderPaidWithdrawService = DIFactory.GetContainer().Resolve <IOrderPaidWithdrawService>(); OrderPaidWithdraw orderPaidWithdraw = new OrderPaidWithdraw(); orderPaidWithdraw.OrderPaid = orderPaid; orderPaidWithdraw.Amount = orderPaid.TransactionAmount; iOrderPaidWithdrawService.Save(orderPaidWithdraw); iOrderPaidWithdrawService.Commit(); var withdrawResponse = iGuangDaAPIService.Withdraw(orderPaidWithdraw); orderPaidWithdraw.ResponseCode = withdrawResponse.Head.ResCode; orderPaidWithdraw.ResponseMessage = withdrawResponse.Head.ResMsg; if (withdrawResponse.IsOK) { WithdrawSuccess(orderPaidWithdraw); Commit(); } else if (withdrawResponse.IsWait) { orderPaid.Status = OrderPaidStatusOption.WithdrawWait.ToInt(); Save(orderPaid); orderPaidWithdraw.Status = OrderPaidWithdrawStatusOption.Wait.ToInt(); iOrderPaidWithdrawService.Save(orderPaidWithdraw); Commit(); throw new APIException("提现中,请查询确认(" + withdrawResponse.Head.ResMsg + ")"); } else { WithdrawFail(orderPaidWithdraw); Commit(); throw new APIException("提现失败:" + withdrawResponse.Head.ResMsg); } }
/// <summary> /// 提现,五万以下 /// </summary> /// <returns></returns> private EComGAmountResponse SmallWithdraw(OrderPaidWithdraw orderPaidWithdraw) { EComGAmountRequest request = new EComGAmountRequest(); request.Head.ReqJnlNo = GuidHelper.GenUniqueId(); request.Body.Amount = orderPaidWithdraw.Amount.ToString(); request.Body.CifClientId = orderPaidWithdraw.OrderPaid.Member.ClientId; request.Body.Currency = "CNY"; request.Body.ChannelSeq = orderPaidWithdraw.SerialNumber; request.Body.TrsDate = DateTime.Now.ToString("yyyyMMdd"); request.Body.WDType = "1"; request.Body.Remark = "提现"; request.Body.WDName = orderPaidWithdraw.OrderPaid.Member.Name; request.Body.IdType = "P00"; request.Body.IdNo = orderPaidWithdraw.OrderPaid.Member.IDNumber; request.Body.WDAcNo = orderPaidWithdraw.OrderPaid.Member.BankCardNumber; request.Body.WDBankNo = orderPaidWithdraw.OrderPaid.Member.BankCard.Bank.CodeGuangDa; request.Body.WDInnerBankFlag = orderPaidWithdraw.OrderPaid.Member.BankCard.Bank.CodeGuangDa != "303100000006" ? "1" : "0"; request.Body.Reserve1 = ""; request.Body.Reserve2 = ""; request.Body.Reserve3 = ""; //request.Body.CifClientId = "6d57392972f663e6"; //request.Body.Currency = "CNY"; //request.Body.ChannelSeq = GuidHelper.GenUniqueId(); //request.Body.TrsDate = DateTime.Now.ToString("yyyyMMdd"); //request.Body.WDType = "1"; //request.Body.Remark = "提现"; //request.Body.WDName = "廖一"; //request.Body.IdType = "P00"; //request.Body.IdNo = "460031198806150013"; //request.Body.WDAcNo = "6212260200000110001"; //request.Body.WDBankNo = "102100099996"; //request.Body.WDInnerBankFlag = "1"; //request.Body.Reserve1 = ""; //request.Body.Reserve2 = ""; //request.Body.Reserve3 = ""; var result = guangDaExec.Exec(request) as EComGAmountResponse; return(result); }
private void WithdrawSuccess(OrderPaidWithdraw orderPaidWithdraw) { var iOrderPaidWithdrawService = DIFactory.GetContainer().Resolve <IOrderPaidWithdrawService>(); var iMemberService = DIFactory.GetContainer().Resolve <IMemberService>(); if (orderPaidWithdraw.OrderPaid.PayAction == OrderPaidPayActionOption.Repeal.ToInt()) { orderPaidWithdraw.OrderPaid.Status = OrderPaidStatusOption.Repeal.ToInt(); } else { orderPaidWithdraw.OrderPaid.Status = OrderPaidStatusOption.WithdrawSuccess.ToInt(); } Save(orderPaidWithdraw.OrderPaid); orderPaidWithdraw.Status = OrderPaidWithdrawStatusOption.Success.ToInt(); orderPaidWithdraw.TransTime = DateTime.Now; iOrderPaidWithdrawService.Save(orderPaidWithdraw); iMemberService.BalanceChange(orderPaidWithdraw.OrderPaid.Member, orderPaidWithdraw.Amount * -1, MemberBalanceHistoryTypeOption.Withdraw, (AccountBankOption)orderPaidWithdraw.OrderPaid.Merchant.AccountBank, remark: orderPaidWithdraw.SerialNumber); }