add PaymentTransactionValidatePending.cs file

This commit is contained in:
MahanCh
2025-07-29 16:06:03 +03:30
parent 7ae08fe023
commit 4d45ee36b6
4 changed files with 27 additions and 11 deletions

View File

@@ -1,6 +0,0 @@
namespace ServiceHost;
public class AppSettingConfiguration
{
public string Domain { get; set; }
}

View File

@@ -19,8 +19,4 @@
<ProjectReference Include="..\WorkFlow\Infrastructure\WorkFlow.Infrastructure.Config\WorkFlow.Infrastructure.Config.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Jobs\Task\" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,27 @@
using _0_Framework.Application;
using _0_Framework.Application.PaymentGateway;
using CompanyManagment.App.Contracts.PaymentTransaction;
using CompanyManagment.EFCore;
using Microsoft.Extensions.Options;
namespace BackgroundService.Jobs.PaymentTransactions;
public class PaymentTransactionValidatePending
{
private readonly CompanyContext _companyContext;
private readonly IPaymentGateway _paymentGateway;
public PaymentTransactionValidatePending(CompanyContext companyContext, IHttpClientFactory httpClientFactory,IOptions<AppSettingConfiguration> appSetting)
{
_companyContext = companyContext;
_paymentGateway = new AqayePardakhtPaymentGateway(httpClientFactory,appSetting);
}
public async Task Execute()
{
var paymentTransactions = _companyContext.PaymentTransactions.Where(x =>
x.Status == PaymentTransactionStatus.Pending && x.CreationDate.AddMinutes(30) <= DateTime.Now);
//Todo: وریفای تراکنش
}
}

View File

@@ -8,7 +8,6 @@ using BackgroundService.Services;
using Hangfire;
using PersonalContractingParty.Config;
using Query.Bootstrapper;
using ServiceHost;
using WorkFlow.Infrastructure.Config;
var builder = WebApplication.CreateBuilder(args);