| | |
| | | using FlexJobApi.Core; |
| | | using Azure; |
| | | using FlexJobApi.Core; |
| | | using Furion; |
| | | using Furion.DatabaseAccessor; |
| | | using Furion.FriendlyException; |
| | | using MediatR; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using Org.BouncyCastle.Ocsp; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | |
| | | /// 支付宝通知回传 |
| | | /// </summary> |
| | | public class GetAlipayNotifyCommandHandler( |
| | | IHttpContextAccessor httpContextAccessor |
| | | IRepository<EnterpriseWallet> rep, |
| | | IMediator mediator |
| | | ) : |
| | | IRequestHandler<GetAlipayNotifyCommand, bool>, |
| | | IRequestHandler<AlipayUserAgreementPageSignNotifyCommand, bool> |
| | | { |
| | | private readonly IHttpContextAccessor httpContextAccessor = httpContextAccessor; |
| | | private readonly IRepository<EnterpriseWallet> rep = rep; |
| | | private readonly IMediator mediator = mediator; |
| | | |
| | | /// <summary> |
| | | /// 支付宝通知回传 |
| | |
| | | /// <param name="request"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | public Task<bool> Handle(AlipayUserAgreementPageSignNotifyCommand request, CancellationToken cancellationToken) |
| | | public async Task<bool> Handle(AlipayUserAgreementPageSignNotifyCommand request, CancellationToken cancellationToken) |
| | | { |
| | | Console.WriteLine(httpContextAccessor.HttpContext.Request.QueryString); |
| | | return Task.FromResult(true); |
| | | var entity = await rep.AsQueryable() |
| | | .Where(it => it.Code == request.external_agreement_no) |
| | | .FirstOrDefaultAsync(); |
| | | if (entity == null) throw Oops.Oh(EnumErrorCodeType.s404, "企业钱包"); |
| | | await mediator.Send(new GetEnterpriseWalletQuery |
| | | { |
| | | EnterpriseId = entity.EnterpriseId, |
| | | Access = EnumEnterpriseWalletAccess.Alipay |
| | | }); |
| | | return true; |
| | | } |
| | | } |
| | | } |