zhengyuxuan
2025-03-20 ed7a62536dcb48383b13c4b7875755c81b48dd96
fix:回调bug修复
4个文件已修改
30 ■■■■ 已修改文件
LifePayment/LifePayment.Application/LifePay/LifePayService.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.HttpApi/LifePay/ACOOLYNotifyController.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.HttpApi/LifePay/AliPayNotifyController.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.HttpApi/LifePay/WxPayNotifyController.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application/LifePay/LifePayService.cs
@@ -273,6 +273,7 @@
        var channleRate = await _lifePayChannlesRep.FirstOrDefaultAsync(r => r.ChannlesNum == order.ChannelId);
        var premiumRate = await _lifePayPremiumRepository.Where(x => x.IsDeleted == false && x.PremiumType == order.LifePayType).FirstOrDefaultAsync();
        CheckExtensions.IfTrueThrowUserFriendlyException(order == null, "订单不存在");
        var channlesRakePrice = (order.PayAmount - (order.PlatformDeductionAmount == null ? 0 : order.PlatformDeductionAmount)) * channleRate.ChannlesRakeRate / 100;
        var result = new LifePayOrderOutput()
                {
            DiscountAmount = order.DiscountAmount,
@@ -300,9 +301,9 @@
            PlatformPrice = order.PlatformDeductionAmount,
            ChannleRate = channleRate.ChannlesRate,
            ChannlesRakeRate = channleRate.ChannlesRakeRate,
            ChannlesRakePrice = (order.PayAmount - order.PlatformDeductionAmount) * channleRate.ChannlesRakeRate / 100,
            PremiumRate = premiumRate == null ? default : premiumRate.Rate,
            PremiumPrice = premiumRate == null ? default : Math.Round(order.PayAmount * premiumRate.Rate, 2),
            ChannlesRakePrice = channlesRakePrice.HasValue ? 0 : Math.Round(channlesRakePrice.Value, 2),
            PremiumRate = premiumRate == null ? 0 : premiumRate.Rate,
            PremiumPrice = premiumRate == null ? 0 : Math.Round(order.PayAmount * premiumRate.Rate, 2),
            Profit = (order.PayAmount - order.PlatformDeductionAmount) * (1.00m - channleRate.ChannlesRakeRate / 100) - (premiumRate == null ? 0 : Math.Round(order.PayAmount * premiumRate.Rate, 2))
        };
LifePayment/LifePayment.HttpApi/LifePay/ACOOLYNotifyController.cs
@@ -78,15 +78,7 @@
                    if (confirmElectricOrderResponse.ElectricChargeOrder.Status == ACOOLYConstant.Status.充值成功)
                    {
                        status = LifePayOrderStatusEnum.已完成;
                        if (confirmElectricOrderResponse.ElectricChargeOrder.ParValue == confirmElectricOrderResponse.ElectricChargeOrder.PayAmount)
                        {
                            acoolyStatus = ACOOLYStatusEnum.充值成功;
                        }
                        else
                        {
                            acoolyStatus = ACOOLYStatusEnum.部分充值成功;
                        }
                    }
                    else
@@ -119,15 +111,7 @@
                    if (confirmPhoneOrderResponse.PhoneChargeOrder.Status == ACOOLYConstant.Status.充值成功)
                    {
                        status = LifePayOrderStatusEnum.已完成;
                        if (confirmPhoneOrderResponse.PhoneChargeOrder.ParValue == confirmPhoneOrderResponse.PhoneChargeOrder.PayAmount)
                        {
                            acoolyStatus = ACOOLYStatusEnum.充值成功;
                        }
                        else
                        {
                            acoolyStatus = ACOOLYStatusEnum.部分充值成功;
                        }
                    }
                    else
@@ -169,6 +153,7 @@
                        //{
                        //    acoolyStatus = ACOOLYStatusEnum.部分充值成功;
                        //}
                        acoolyStatus = ACOOLYStatusEnum.充值成功;
                    }
                    else
LifePayment/LifePayment.HttpApi/LifePay/AliPayNotifyController.cs
@@ -51,7 +51,7 @@
            //var serializeRequest = "{\"gmt_create\":\"2025-02-25 13:18:59\",\"charset\":\"UTF-8\",\"seller_email\":\"zfb1@818nb.com\",\"subject\":\"生活缴费-话费\",\"sign\":\"Sp06G1GxrAfDvoHPz9l3DJ20SxhvRzEGFeCGu4LHrSWmEG4OY7MHMx+iJi54ETbdXV0YsyDH9JZD7PWN3HCpEq/wGO4Wh4VSYSe7lqxD6r4f/HFiB0YlrdQoSzjZgYPzLjy6bcdlKRRHOeDkgs2i7TfvIsxWxHs9t0xuS0RlkpdZfb7d7m0EuZ/3v2Cbsj5AHjxb1S2PkO0oQyriYgGQdmkPqILZHwieST+tNEHS4dGFKYu2nkfctAGjWIDv/hKQNY7jEUxsEeG0SnK4TPU8zNplFR9/aKM0Wfwp1pdlaiP2u/d8vOtNh5q+emvaYbKrUkIEFBok8pDLNDta7ZjtVw==\",\"invoice_amount\":\"0.01\",\"buyer_open_id\":\"071xYXDfXBLAI9U11jg_WrH1K6hWq8HYGz0u85xBivf3Sce\",\"notify_id\":\"2025022501222131904087711494539601\",\"fund_bill_list\":\"[{\\\"amount\\\":\\\"0.01\\\",\\\"fundChannel\\\":\\\"ALIPAYACCOUNT\\\"}]\",\"notify_type\":\"trade_status_sync\",\"trade_status\":\"TRADE_SUCCESS\",\"receipt_amount\":\"0.01\",\"buyer_pay_amount\":\"0.01\",\"app_id\":\"2021004171602214\",\"sign_type\":\"RSA2\",\"seller_id\":\"2088050542042301\",\"gmt_payment\":\"2025-02-25 13:19:03\",\"notify_time\":\"2025-02-25 13:44:34\",\"merchant_app_id\":\"2021004171602214\",\"version\":\"1.0\",\"out_trade_no\":\"JF202502251318555214671\",\"total_amount\":\"0.01\",\"trade_no\":\"2025022522001487711401331043\",\"auth_app_id\":\"2021004171602214\",\"buyer_logon_id\":\"130****2238\",\"point_amount\":\"0.00\"}";
            var input = JsonConvert.DeserializeObject<AliRechargeNotifyInput>(serializeRequest);
            if (input.OutTradeNo.StartsWith("JF") && Regex.IsMatch(input.OutTradeNo, @"^JF\d+$"))
            if (input.OutTradeNo.Contains("JF"))
            {
                if (input.TradeStatus == LifePaymentConstant.AliPayStatus.支付成功)
                {
@@ -72,7 +72,7 @@
        [AllowAnonymous]
        public async Task<ContentResult> TestAliRechargeNotify(string outTradeNo, string tradeNo, bool success)
        {
            if (outTradeNo.StartsWith("JF") && Regex.IsMatch(outTradeNo, @"^JF\d+$"))
            if (outTradeNo.Contains("JF"))
            {
                if (success)
                {
LifePayment/LifePayment.HttpApi/LifePay/WxPayNotifyController.cs
@@ -48,7 +48,7 @@
                var data = _wxPayApi.AesGcmDecrypt(input.Resource.AssociatedData, input.Resource.Nonce, input.Resource.Ciphertext);
                var wxPayNotice = JsonConvert.DeserializeObject<WxPayNotice>(data);
                if (wxPayNotice.OutTradeNo.StartsWith("JF") && Regex.IsMatch(wxPayNotice.OutTradeNo, @"^JF\d+$"))
                if (wxPayNotice.OutTradeNo.Contains("JF") )
                {
                    if (wxPayNotice.TradeState == LifePaymentConstant.WxPayStatus.支付成功)
                    {