From 4d45ee36b6a142c47a937fdba32a3d369585b519 Mon Sep 17 00:00:00 2001 From: MahanCh Date: Tue, 29 Jul 2025 16:06:03 +0330 Subject: [PATCH] add PaymentTransactionValidatePending.cs file --- BackgroundService/AppSettingConfiguration.cs | 6 ----- BackgroundService/BackgroundService.csproj | 4 --- .../PaymentTransactionValidatePending.cs | 27 +++++++++++++++++++ BackgroundService/Program.cs | 1 - 4 files changed, 27 insertions(+), 11 deletions(-) delete mode 100644 BackgroundService/AppSettingConfiguration.cs create mode 100644 BackgroundService/Jobs/PaymentTransactions/PaymentTransactionValidatePending.cs 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);