zhengyiming
2025-04-01 a3f1926a7530fd4a3b9196824a8e8b00c693e6e3
LifePayment/LifePayment.HttpApi/LifePay/ACOOLYNotifyController.cs
@@ -52,10 +52,11 @@
            }
            var baseInfo = JsonConvert.DeserializeObject<ACOOLYRequestBaseResponse>(body);
            var orderNo = string.Empty;
            var status = LifePayOrderStatusEnum.待确认;
            var acoolyStatus = ACOOLYStatusEnum.充值失败;
            LifePayOrderStatusEnum status = LifePayOrderStatusEnum.待退款;
            ACOOLYStatusEnum acoolyStatus = ACOOLYStatusEnum.充值失败;
            var acoolyOrderNo = string.Empty;
            decimal payAmount = 0;
            string refundApplyRemark = string.Empty;
            _logger.LogError("ACOOLY回调通处理类型:" + baseInfo.Service);
            _logger.LogError("ACOOLY回调内容:" + body);
            switch (baseInfo.Service)
@@ -70,28 +71,27 @@
                    if (!confirmElectricOrderResponse.Success
                    || (confirmElectricOrderResponse.Code != ACOOLYConstant.Code.SUCCESS && confirmElectricOrderResponse.Code != ACOOLYConstant.Code.PROCESSING))
                    {
                        status = LifePayOrderStatusEnum.已失败;
                        status = LifePayOrderStatusEnum.待退款;
                        acoolyStatus = ACOOLYStatusEnum.充值失败;
                    }
                    else
                    if (confirmElectricOrderResponse.ElectricChargeOrder.Status == ACOOLYConstant.Status.充值成功)
                    {
                        status = LifePayOrderStatusEnum.已完成;
                        acoolyStatus = ACOOLYStatusEnum.充值成功;
                    }
                    else
                    if (confirmElectricOrderResponse.ElectricChargeOrder.Status == ACOOLYConstant.Status.充值中)
                    {
                        status = LifePayOrderStatusEnum.待确认;
                        status = LifePayOrderStatusEnum.充值中;
                        acoolyStatus = ACOOLYStatusEnum.充值中;
                    }
                    else
                    if (confirmElectricOrderResponse.ElectricChargeOrder.Status == ACOOLYConstant.Status.充值失败)
                    {
                        status = LifePayOrderStatusEnum.已失败;
                        status = LifePayOrderStatusEnum.待退款;
                        acoolyStatus = ACOOLYStatusEnum.充值失败;
                        refundApplyRemark = "供应商充值失败";
                    }
                    else
                    if (confirmElectricOrderResponse.ElectricChargeOrder.Status == ACOOLYConstant.Status.退款中)
@@ -108,7 +108,7 @@
                    else
                    if (confirmElectricOrderResponse.ElectricChargeOrder.Status == ACOOLYConstant.Status.失败关闭)
                    {
                        status = LifePayOrderStatusEnum.已失败;
                        status = LifePayOrderStatusEnum.待退款;
                        acoolyStatus = ACOOLYStatusEnum.充值失败;
                    }
                    break;
@@ -121,7 +121,7 @@
                    if (!confirmPhoneOrderResponse.Success
                     || (confirmPhoneOrderResponse.Code != ACOOLYConstant.Code.SUCCESS && confirmPhoneOrderResponse.Code != ACOOLYConstant.Code.PROCESSING))
                    {
                        status = LifePayOrderStatusEnum.已失败;
                        status = LifePayOrderStatusEnum.待退款;
                        acoolyStatus = ACOOLYStatusEnum.充值失败;
                    }
                    else
@@ -135,13 +135,13 @@
                     if (confirmPhoneOrderResponse.PhoneChargeOrder.Status == ACOOLYConstant.Status.充值中)
                    {
                        status = LifePayOrderStatusEnum.待确认;
                        status = LifePayOrderStatusEnum.充值中;
                        acoolyStatus = ACOOLYStatusEnum.充值中;
                    }
                    else
                     if (confirmPhoneOrderResponse.PhoneChargeOrder.Status == ACOOLYConstant.Status.充值失败)
                    {
                        status = LifePayOrderStatusEnum.已失败;
                        status = LifePayOrderStatusEnum.待退款;
                        acoolyStatus = ACOOLYStatusEnum.充值失败;
                    }
                    else
@@ -159,7 +159,7 @@
                    else
                     if (confirmPhoneOrderResponse.PhoneChargeOrder.Status == ACOOLYConstant.Status.失败关闭)
                    {
                        status = LifePayOrderStatusEnum.已失败;
                        status = LifePayOrderStatusEnum.待退款;
                        acoolyStatus = ACOOLYStatusEnum.充值失败;
                    }
                    break;
@@ -172,7 +172,7 @@
                    if (!confirmGasOrderResponse.Success
                     || (confirmGasOrderResponse.Code != ACOOLYConstant.Code.SUCCESS && confirmGasOrderResponse.Code != ACOOLYConstant.Code.PROCESSING))
                    {
                        status = LifePayOrderStatusEnum.已失败;
                        status = LifePayOrderStatusEnum.待退款;
                        acoolyStatus = ACOOLYStatusEnum.充值失败;
                    }
                    else
@@ -186,13 +186,13 @@
                     if (confirmGasOrderResponse.GasChargeOrder.Status == ACOOLYConstant.Status.充值中)
                    {
                        status = LifePayOrderStatusEnum.待确认;
                        status = LifePayOrderStatusEnum.待退款;
                        acoolyStatus = ACOOLYStatusEnum.充值中;
                    }
                    else
                     if (confirmGasOrderResponse.GasChargeOrder.Status == ACOOLYConstant.Status.充值失败)
                    {
                        status = LifePayOrderStatusEnum.已失败;
                        status = LifePayOrderStatusEnum.待退款;
                        acoolyStatus = ACOOLYStatusEnum.充值失败;
                    }
                    else
@@ -210,15 +210,15 @@
                    else
                     if (confirmGasOrderResponse.GasChargeOrder.Status == ACOOLYConstant.Status.失败关闭)
                    {
                        status = LifePayOrderStatusEnum.已失败;
                        status = LifePayOrderStatusEnum.待退款;
                        acoolyStatus = ACOOLYStatusEnum.充值失败;
                    }
                    break;
                default:
                    break;
                    throw new UserFriendlyException("ACOOLY回调通处理类型不存在");
            }
            await _lifePayService.ACOOLYOrderNotifyHandler(orderNo, acoolyOrderNo, status, acoolyStatus, payAmount);
            await _lifePayService.ACOOLYOrderNotifyHandler(orderNo, acoolyOrderNo, status, acoolyStatus, payAmount, refundApplyRemark);
        }
    }
}