From a3bfd6cd7ee9580db08aa03a8656ad5572089756 Mon Sep 17 00:00:00 2001 From: zhengyiming <540361168@qq.com> Date: 星期一, 31 三月 2025 16:19:36 +0800 Subject: [PATCH] Merge branch 'dev-lifepay-v1.3' of http://120.26.58.240:8888/r/LifePaymentApi into dev-lifepay-v1.3 --- LifePayment/LifePayment.HttpApi/LifePay/WxPayNotifyController.cs | 32 ++++++++++++++++++++++++++++---- 1 files changed, 28 insertions(+), 4 deletions(-) diff --git a/LifePayment/LifePayment.HttpApi/LifePay/WxPayNotifyController.cs b/LifePayment/LifePayment.HttpApi/LifePay/WxPayNotifyController.cs index 454dc62..970139a 100644 --- a/LifePayment/LifePayment.HttpApi/LifePay/WxPayNotifyController.cs +++ b/LifePayment/LifePayment.HttpApi/LifePay/WxPayNotifyController.cs @@ -21,16 +21,19 @@ private readonly IWxPayApi _wxPayApi; private readonly ILifePayService _lifePayService; + private readonly ILifePayOrderService _lifePayOrderService; private readonly ILogger<WxPayNotifyController> _logger; public WxPayNotifyController( IWxPayApi wxPayApi, ILogger<WxPayNotifyController> logger, - ILifePayService lifePayService) + ILifePayService lifePayService, + ILifePayOrderService lifePayOrderService) { _wxPayApi = wxPayApi; _logger = logger; _lifePayService = lifePayService; + _lifePayOrderService = lifePayOrderService; } /// <summary> @@ -53,6 +56,16 @@ if (wxPayNotice.TradeState == LifePaymentConstant.WxPayStatus.鏀粯鎴愬姛) { await _lifePayService.LifePaySuccessHandler(wxPayNotice.OutTradeNo, wxPayNotice.TransactionId); + + // 鎻掑叆鏀舵敮娴佹按 + await _lifePayOrderService.AddLifePayExpensesReceipts(new AddLifePayExpensesReceiptsInput() + { + OrderNo = wxPayNotice.OutTradeNo, + OutOrderNo = wxPayNotice.TransactionId, + LifePayType = LifePayTypeEnum.WxPay, + ExpensesReceiptsType = ExpensesReceiptsTypeEnum.Expenses, + Amount = wxPayNotice.Amount.Total + }); } } } @@ -72,7 +85,11 @@ }; } - + /// <summary> + /// 寰俊閫�娆鹃�氱煡鍥炶皟 + /// </summary> + /// <param name="input"></param> + /// <returns></returns> [HttpPost] [UnitOfWork] public async Task<WxRechargeNotifyResult> WxPayDomesticRefundsNotify(WxRechargeNotifyInput input) @@ -92,10 +109,17 @@ switch (wxPayNotice.RefundStatus) { case LifePaymentConstant.WxPayRefundStatus.閫�娆炬垚鍔�: - await _lifePayService.WxPayDomesticRefundsHandler(wxPayNotice.OutTradeNo, LifePayRefundStatusEnum.宸查��娆�); - break; 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