27 lines
1012 B
C#
27 lines
1012 B
C#
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: وریفای تراکنش
|
|
|
|
|
|
}
|
|
} |