From d3df5273d83fefa80e988300f1d33387985c811c Mon Sep 17 00:00:00 2001
From: zhengyuxuan <zhengyuxuan1995>
Date: 星期一, 31 三月 2025 17:33:28 +0800
Subject: [PATCH] fix:支付宝支付回调

---
 LifePayment/LifePayment.HttpApi/LifePay/AliPayNotifyController.cs |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/LifePayment/LifePayment.HttpApi/LifePay/AliPayNotifyController.cs b/LifePayment/LifePayment.HttpApi/LifePay/AliPayNotifyController.cs
index e2cbb0a..e5b41c0 100644
--- a/LifePayment/LifePayment.HttpApi/LifePay/AliPayNotifyController.cs
+++ b/LifePayment/LifePayment.HttpApi/LifePay/AliPayNotifyController.cs
@@ -1,4 +1,5 @@
 锘縰sing Alipay.AopSdk.F2FPay.Model;
+using Castle.Core.Internal;
 using LifePayment.Application.Contracts;
 using LifePayment.Domain.Shared;
 using Microsoft.AspNetCore.Authorization;
@@ -11,6 +12,7 @@
 using System.Threading.Tasks;
 using Volo.Abp.AspNetCore.Mvc;
 using Volo.Abp.Uow;
+using ZeroD.Util;
 
 namespace LifePayment.HttpApi
 {
@@ -57,7 +59,7 @@
 
             if (input.OutTradeNo.Contains("JF"))
             {
-                if (input.TradeStatus == LifePaymentConstant.AliPayStatus.鏀粯鎴愬姛)
+                if (input.TradeStatus == LifePaymentConstant.AliPayStatus.鏀粯鎴愬姛 && input.OutBizNo.IsNullOrEmpty())
                 {
                     await _lifePayService.LifePaySuccessHandler(input.OutTradeNo, input.TradeNo);
                     // 鎻掑叆鏀舵敮娴佹按
@@ -65,6 +67,20 @@
                         OutOrderNo = input.TradeNo ,LifePayType = LifePayTypeEnum.AliPay,ExpensesReceiptsType = ExpensesReceiptsTypeEnum.Expenses,
                         Amount = input.ReceiptAmount.Value });
                 }
+                else if((input.TradeStatus == LifePaymentConstant.AliPayStatus.鏀粯鎴愬姛 && input.OutBizNo.IsNotNullOrEmpty() && input.RefundFee.HasValue) ||
+                    input.TradeStatus == LifePaymentConstant.AliPayStatus.瓒呮椂鍏抽棴)
+                {
+                    await _lifePayService.LifePayRefundsHandler(input.OutTradeNo, LifePayRefundStatusEnum.宸查��娆�);
+                    // 鎻掑叆鏀舵敮娴佹按
+                    await _lifePayOrderService.AddLifePayExpensesReceipts(new AddLifePayExpensesReceiptsInput()
+                    {
+                        OrderNo = input.OutTradeNo,
+                        OutOrderNo = input.TradeNo,
+                        LifePayType = LifePayTypeEnum.AliPay,
+                        ExpensesReceiptsType = ExpensesReceiptsTypeEnum.Receipts,
+                        Amount = input.ReceiptAmount.Value
+                    });
+                }
             }
             else
             {

--
Gitblit v1.9.1