From 9810e089cb8f0615e333f7e79606e3a0a56e7787 Mon Sep 17 00:00:00 2001
From: zhengyuxuan <zhengyuxuan1995>
Date: 星期一, 31 三月 2025 16:14:10 +0800
Subject: [PATCH] fix:提交

---
 LifePayment/LifePayment.HttpApi/LifePay/WxPayNotifyController.cs  |   11 +++++++++++
 LifePayment/LifePayment.Domain/WeChat/WxRechargeInfo.cs           |   35 +++++++++++++++++++++++++++++++++++
 LifePayment/LifePayment.HttpApi/LifePay/AliPayNotifyController.cs |    1 +
 3 files changed, 47 insertions(+), 0 deletions(-)

diff --git a/LifePayment/LifePayment.Domain/WeChat/WxRechargeInfo.cs b/LifePayment/LifePayment.Domain/WeChat/WxRechargeInfo.cs
index 31035da..b6b6144 100644
--- a/LifePayment/LifePayment.Domain/WeChat/WxRechargeInfo.cs
+++ b/LifePayment/LifePayment.Domain/WeChat/WxRechargeInfo.cs
@@ -241,7 +241,42 @@
         /// </summary>
         [JsonProperty("refund_status")]
         public string RefundStatus { get; set; }
+
+        [JsonProperty("amount")]
+        public RefundAmount Amount { get; set; }
     }
+
+    public class RefundAmount
+    {
+        /// <summary>
+        /// 鎬婚噾棰�
+        /// </summary>
+        [JsonProperty("total", NullValueHandling = NullValueHandling.Ignore)]
+        [Required]
+        public int Total { get; set; }
+
+        /// <summary>
+        /// 閫�娆鹃噾棰�
+        /// </summary>
+        [JsonProperty("refund", NullValueHandling = NullValueHandling.Ignore)]
+        [Required]
+        public int Refund { get; set; }
+
+        /// <summary>
+        /// 鐢ㄦ埛瀹為檯鏀粯閲戦
+        /// </summary>
+        [JsonProperty("payer_total", NullValueHandling = NullValueHandling.Ignore)]
+        [Required]
+        public string PayerTotal { get; set; }
+
+        /// <summary>
+        /// 鐢ㄦ埛閫�娆鹃噾棰�
+        /// </summary>
+        [JsonProperty("payer_refund", NullValueHandling = NullValueHandling.Ignore)]
+        [Required]
+        public string PayerRefund { get; set; }
+    }
+
     public class WxRechargeNotifyResult
     {
         /// <summary>
diff --git a/LifePayment/LifePayment.HttpApi/LifePay/AliPayNotifyController.cs b/LifePayment/LifePayment.HttpApi/LifePay/AliPayNotifyController.cs
index 37a922e..e2cbb0a 100644
--- a/LifePayment/LifePayment.HttpApi/LifePay/AliPayNotifyController.cs
+++ b/LifePayment/LifePayment.HttpApi/LifePay/AliPayNotifyController.cs
@@ -60,6 +60,7 @@
                 if (input.TradeStatus == LifePaymentConstant.AliPayStatus.鏀粯鎴愬姛)
                 {
                     await _lifePayService.LifePaySuccessHandler(input.OutTradeNo, input.TradeNo);
+                    // 鎻掑叆鏀舵敮娴佹按
                     await _lifePayOrderService.AddLifePayExpensesReceipts(new AddLifePayExpensesReceiptsInput() { OrderNo = input.OutTradeNo, 
                         OutOrderNo = input.TradeNo ,LifePayType = LifePayTypeEnum.AliPay,ExpensesReceiptsType = ExpensesReceiptsTypeEnum.Expenses,
                         Amount = input.ReceiptAmount.Value });
diff --git a/LifePayment/LifePayment.HttpApi/LifePay/WxPayNotifyController.cs b/LifePayment/LifePayment.HttpApi/LifePay/WxPayNotifyController.cs
index 5411b49..970139a 100644
--- a/LifePayment/LifePayment.HttpApi/LifePay/WxPayNotifyController.cs
+++ b/LifePayment/LifePayment.HttpApi/LifePay/WxPayNotifyController.cs
@@ -56,6 +56,8 @@
                     if (wxPayNotice.TradeState == LifePaymentConstant.WxPayStatus.鏀粯鎴愬姛)
                     {
                         await _lifePayService.LifePaySuccessHandler(wxPayNotice.OutTradeNo, wxPayNotice.TransactionId);
+
+                        // 鎻掑叆鏀舵敮娴佹按
                         await _lifePayOrderService.AddLifePayExpensesReceipts(new AddLifePayExpensesReceiptsInput()
                         {
                             OrderNo = wxPayNotice.OutTradeNo,
@@ -109,6 +111,15 @@
                         case LifePaymentConstant.WxPayRefundStatus.閫�娆炬垚鍔�:
                         case LifePaymentConstant.WxPayRefundStatus.閫�娆惧叧闂�:
                             await _lifePayService.WxPayDomesticRefundsHandler(wxPayNotice.OutTradeNo, LifePayRefundStatusEnum.宸查��娆�);
+                            // 鎻掑叆鏀舵敮娴佹按
+                            await _lifePayOrderService.AddLifePayExpensesReceipts(new AddLifePayExpensesReceiptsInput()
+                            {
+                                OrderNo = wxPayNotice.OutTradeNo,
+                                OutOrderNo = wxPayNotice.TransactionId,
+                                LifePayType = LifePayTypeEnum.WxPay,
+                                ExpensesReceiptsType = ExpensesReceiptsTypeEnum.Receipts,
+                                Amount = wxPayNotice.Amount.Total
+                            });
                             break;
                         case LifePaymentConstant.WxPayRefundStatus.閫�娆惧鐞嗕腑:
                             await _lifePayService.WxPayDomesticRefundsHandler(wxPayNotice.OutTradeNo, LifePayRefundStatusEnum.閫�娆句腑);

--
Gitblit v1.9.1