add PaymentTransactionValidatePending.cs file
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
namespace ServiceHost;
|
||||
|
||||
public class AppSettingConfiguration
|
||||
{
|
||||
public string Domain { get; set; }
|
||||
}
|
||||
@@ -19,8 +19,4 @@
|
||||
<ProjectReference Include="..\WorkFlow\Infrastructure\WorkFlow.Infrastructure.Config\WorkFlow.Infrastructure.Config.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Jobs\Task\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -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: وریفای تراکنش
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user