| | |
| | | private readonly IRepository<LifePayChannles, Guid> _lifePayChannlesRep; |
| | | private readonly IRepository<LifePayAccount, Guid> _lifePayAccount; |
| | | private readonly IRepository<OperateHistory, Guid> _operateHistory; |
| | | private readonly IRepository<LifePayChannlesRake, Guid> _lifePayChannlesRakeRepository; |
| | | private readonly IDataFilter dataFilter; |
| | | private readonly IChannelFilter _channelFilter; |
| | | private readonly IAliPayApi _aliPayApi; |
| | |
| | | IRepository<LifePayUser, Guid> lifePayUserRepository, |
| | | IRepository<LifePayPremium, Guid> lifePayPremiumRepository, |
| | | IRepository<LifePayIntroInfo, Guid> lifePayIntroInfoRepository, |
| | | IRepository<LifePayChannlesRake, Guid> lifePayChannlesRakeRepository, |
| | | IRepository<OperateHistory, Guid> operateHistory, |
| | | IAliPayApi aliPayApi, |
| | | IAlipayInterfaceManager aliPayInterfaceManager, |
| | |
| | | _lifePayRateRepository = lifePayRateRepository; |
| | | _lifePayOrderRepository = lifePayOrderRepository; |
| | | _lifePayUserRepository = lifePayUserRepository; |
| | | _lifePayChannlesRakeRepository = lifePayChannlesRakeRepository; |
| | | _lifePayPremiumRepository = lifePayPremiumRepository; |
| | | _lifePayIntroInfoRepository = lifePayIntroInfoRepository; |
| | | _aliPayApi = aliPayApi; |
| | |
| | | return await _wxPayApi.WxPayTradeQuery(outTradeNo); |
| | | } |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region 操作 |
| | |
| | | await _lifePayOrderRepository.UpdateAsync(order); |
| | | } |
| | | |
| | | public async Task WxPayDomesticRefundsHandler(string orderNo, LifePayRefundStatusEnum refundStatus) |
| | | public async Task LifePayRefundsHandler(string orderNo, LifePayRefundStatusEnum refundStatus) |
| | | { |
| | | var order = await _lifePayOrderRepository.Where(x => x.OrderNo == orderNo).FirstOrDefaultAsync(); |
| | | CheckExtensions.IfTrueThrowUserFriendlyException(order == null, "订单不存在"); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// ACOOLYO订单通知处理 |
| | | /// </summary> |
| | |
| | | var order = await _lifePayOrderRepository.Where(x => x.OrderNo == orderNo).FirstOrDefaultAsync(); |
| | | CheckExtensions.IfTrueThrowUserFriendlyException(order == null, "订单不存在"); |
| | | |
| | | //if (order.LifePayOrderStatus == LifePayOrderStatusEnum.已完成) |
| | | //{ |
| | | // return; |
| | | //} |
| | | if (order.LifePayOrderStatus == LifePayOrderStatusEnum.已完成 || order.LifePayOrderStatus == LifePayOrderStatusEnum.已退款) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | order.PlatformDeductionAmount = payAmount; |
| | | if (acoolyOrderNo.IsNotNullOrEmpty()) |
| | |
| | | order.ACOOLYStatus = acoolyStatus; |
| | | order.FinishTime = DateTime.Now; |
| | | await _lifePayOrderRepository.UpdateAsync(order); |
| | | |
| | | if (order.LifePayOrderStatus == LifePayOrderStatusEnum.已完成) |
| | | { |
| | | /// 毛利 |
| | | var grossProfit = order.RechargeAmount * (order.ChannleRate - order.PlatformRate) / 100; |
| | | /// 渠道佣金 ((充值面额 * 渠道折扣比例)-(充值面额 * 平台折扣比例))* 佣金比例 |
| | | var channlesRakePrice = grossProfit * (order.ChannlesRakeRate) / 100; |
| | | if (channlesRakePrice.HasValue) |
| | | { |
| | | LifePayChannlesRake lifePayChannlesRake = new LifePayChannlesRake() |
| | | { |
| | | OrderNo = order.OrderNo, |
| | | PayAmount = order.PayAmount.Value, |
| | | ChannlesRakeRate = order.ChannlesRakeRate.Value, |
| | | ChannlesRakePrice = channlesRakePrice.Value, |
| | | FinishTime = order.FinishTime.Value, |
| | | ChannelId = order.ChannelId, |
| | | }; |
| | | await _lifePayChannlesRakeRepository.InsertAsync(lifePayChannlesRake); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | await _lifePayAccount.InsertAsync(userAccount); |
| | | } |
| | | |
| | | if (input.LifePayType == LifePayOrderTypeEnum.PhoneOrder) |
| | | if (input.LifePayType == LifePayOrderTypeEnum.PhoneOrder || input.LifePayType == LifePayOrderTypeEnum.ElectricOrder) |
| | | { |
| | | var extraProperties = JsonConvert.DeserializeObject<Model_UserAccountExtraProperties>(input.ExtraProperties); |
| | | if (!string.IsNullOrEmpty(extraProperties.Name) && extraProperties.Phone == user.PhoneNumber) |
| | |
| | | string message = $"{method}\n{uri}\n{timestamp}\n{nonce}\n{body}\n"; |
| | | return message; |
| | | } |
| | | |
| | | |
| | | private async Task<IQueryable<LifePayOrderListOutput>> GetLifePayOrderListFilter(QueryLifePayOrderListInput input) |
| | | { |