| | |
| | | Code = "SUCCESS", |
| | | }; |
| | | } |
| | | |
| | | |
| | | [HttpPost] |
| | | [UnitOfWork] |
| | | public async Task<WxRechargeNotifyResult> WxPayDomesticRefundsNotify(WxRechargeNotifyInput input) |
| | | { |
| | | try |
| | | { |
| | | _logger.LogError($"微信退款回调通知:进入微信回调"); |
| | | var data = _wxPayApi.AesGcmDecrypt(input.Resource.AssociatedData, input.Resource.Nonce, input.Resource.Ciphertext); |
| | | var wxPayNotice = JsonConvert.DeserializeObject<WxPayDomesticRefundsNotice>(data); |
| | | |
| | | if (wxPayNotice.OutTradeNo.Contains("JF")) |
| | | { |
| | | if (wxPayNotice.RefundStatus == LifePaymentConstant.WxPayRefundStatus.退款成功) |
| | | { |
| | | |
| | | } |
| | | switch (wxPayNotice.RefundStatus) |
| | | { |
| | | case LifePaymentConstant.WxPayRefundStatus.退款成功: |
| | | await _lifePayService.WxPayDomesticRefundsHandler(wxPayNotice.OutTradeNo, LifePayRefundStatusEnum.已退款); |
| | | break; |
| | | case LifePaymentConstant.WxPayRefundStatus.退款关闭: |
| | | await _lifePayService.WxPayDomesticRefundsHandler(wxPayNotice.OutTradeNo, LifePayRefundStatusEnum.已退款); |
| | | break; |
| | | case LifePaymentConstant.WxPayRefundStatus.退款处理中: |
| | | await _lifePayService.WxPayDomesticRefundsHandler(wxPayNotice.OutTradeNo, LifePayRefundStatusEnum.退款中); |
| | | break; |
| | | case LifePaymentConstant.WxPayRefundStatus.退款异常: |
| | | await _lifePayService.WxPayDomesticRefundsHandler(wxPayNotice.OutTradeNo, LifePayRefundStatusEnum.退款中); |
| | | break; |
| | | default : await _lifePayService.WxPayDomesticRefundsHandler(wxPayNotice.OutTradeNo, LifePayRefundStatusEnum.退款中);break; |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | return new WxRechargeNotifyResult |
| | | { |
| | | Code = "FAIL", |
| | | Message = ex.Message, |
| | | }; |
| | | } |
| | | |
| | | return new WxRechargeNotifyResult |
| | | { |
| | | Code = "SUCCESS", |
| | | }; |
| | | } |
| | | } |
| | | } |