diff --git a/BackgroundService/AppSettingConfiguration.cs b/BackgroundService/AppSettingConfiguration.cs deleted file mode 100644 index 3abad3fb..00000000 --- a/BackgroundService/AppSettingConfiguration.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace ServiceHost; - -public class AppSettingConfiguration -{ - public string Domain { get; set; } -} \ No newline at end of file diff --git a/BackgroundService/BackgroundService.csproj b/BackgroundService/BackgroundService.csproj index 04656488..bd14b71a 100644 --- a/BackgroundService/BackgroundService.csproj +++ b/BackgroundService/BackgroundService.csproj @@ -19,8 +19,4 @@ - - - - diff --git a/BackgroundService/Jobs/PaymentTransactions/PaymentTransactionValidatePending.cs b/BackgroundService/Jobs/PaymentTransactions/PaymentTransactionValidatePending.cs new file mode 100644 index 00000000..f35153a9 --- /dev/null +++ b/BackgroundService/Jobs/PaymentTransactions/PaymentTransactionValidatePending.cs @@ -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 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: وریفای تراکنش + + + } +} \ No newline at end of file diff --git a/BackgroundService/Program.cs b/BackgroundService/Program.cs index 5a27404b..4f00341d 100644 --- a/BackgroundService/Program.cs +++ b/BackgroundService/Program.cs @@ -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);