| | |
| | | private readonly IAlipayInterfaceManager _alipayInterfaceManager; |
| | | private readonly IWxPayApi _wxPayApi; |
| | | private readonly WxPayOption _wxPayOptions; |
| | | private readonly InitSetting _initSettingOptions; |
| | | |
| | | private readonly IACOOLYManager _aCOOLYManager; |
| | | |
| | |
| | | IAlipayInterfaceManager aliPayInterfaceManager, |
| | | IWxPayApi wxPayApi, |
| | | IOptions<WxPayOption> wxPayOptions, |
| | | IOptions<InitSetting> initSettingOptions, |
| | | IRepository<LifePayChannles, Guid> lifePayChannlesRep, |
| | | IRepository<LifePayAccount, Guid> lifePayAccount, |
| | | IDataFilter dataFilter, |
| | |
| | | _alipayInterfaceManager = aliPayInterfaceManager; |
| | | _wxPayApi = wxPayApi; |
| | | _wxPayOptions = wxPayOptions.Value; |
| | | _initSettingOptions = initSettingOptions.Value; |
| | | _distributedEventBus = distributedEventBus; |
| | | _lifePayChannlesRep = lifePayChannlesRep; |
| | | _lifePayAccount = lifePayAccount; |
| | |
| | | |
| | | private (decimal PayAmont, decimal DiscountAmount, decimal RechargeAmount) CalculateAmount(decimal amount, decimal rate) |
| | | { |
| | | /// 正常支付 |
| | | var payAmount = decimal.Round(amount * rate / 100, 2, MidpointRounding.AwayFromZero); |
| | | if (_initSettingOptions.OpenTheOnePennyTest) |
| | | { |
| | | /// 1分钱支付 |
| | | decimal payAmount = 0.01m; |
| | | |
| | | /// 1分钱支付 |
| | | //decimal payAmount = 0.01m; |
| | | CheckExtensions.IfTrueThrowUserFriendlyException(payAmount < 0.01m, "支付金额错误"); |
| | | |
| | | CheckExtensions.IfTrueThrowUserFriendlyException(payAmount < 0.01m, "支付金额错误"); |
| | | |
| | | return (payAmount, amount - payAmount, amount); |
| | | return (payAmount, amount - payAmount, amount); |
| | | } |
| | | else |
| | | { |
| | | /// 正常支付 |
| | | var payAmount = decimal.Round(amount * rate / 100, 2, MidpointRounding.AwayFromZero); |
| | | return (payAmount, amount - payAmount, amount); |
| | | } |
| | | } |
| | | |
| | | private void SetOrderStatus(LifePayOrder order, string code) |