add: integrate ILogger for SepehrPaymentGateway logging

This commit is contained in:
2025-12-31 19:12:12 +03:30
parent a49b825ce9
commit ce305edac4
5 changed files with 17 additions and 10 deletions

View File

@@ -26,6 +26,7 @@ using CompanyManagment.App.Contracts.InstitutionContractContactinfo;
using CompanyManagment.App.Contracts.PaymentTransaction;
using CompanyManagment.App.Contracts.SepehrPaymentGateway;
using CompanyManagment.App.Contracts.Workshop;
using Microsoft.Extensions.Logging;
using PersianTools.Core;
using ConnectedPersonnelViewModel = CompanyManagment.App.Contracts.Workshop.ConnectedPersonnelViewModel;
using FinancialStatment = Company.Domain.FinancialStatmentAgg.FinancialStatment;
@@ -61,7 +62,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
IAccountApplication accountApplication, ISmsService smsService,
IFinancialInvoiceRepository financialInvoiceRepository, IHttpClientFactory httpClientFactory,
IPaymentTransactionRepository paymentTransactionRepository, IRollCallServiceRepository rollCallServiceRepository,
ISepehrPaymentGatewayService sepehrPaymentGatewayService)
ISepehrPaymentGatewayService sepehrPaymentGatewayService,ILogger<SepehrPaymentGateway> sepehrGatewayLogger)
{
_institutionContractRepository = institutionContractRepository;
_contractingPartyRepository = contractingPartyRepository;
@@ -78,7 +79,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
_paymentTransactionRepository = paymentTransactionRepository;
_rollCallServiceRepository = rollCallServiceRepository;
_sepehrPaymentGatewayService = sepehrPaymentGatewayService;
_paymentGateway = new SepehrPaymentGateway(httpClientFactory);
_paymentGateway = new SepehrPaymentGateway(httpClientFactory,sepehrGatewayLogger);
}
public OperationResult Create(CreateInstitutionContract command)

View File

@@ -18,6 +18,7 @@ using Company.Domain.FinancialStatmentAgg;
using Company.Domain.FinancialTransactionAgg;
using Company.Domain.InstitutionContractAgg;
using CompanyManagment.EFCore.Migrations;
using Microsoft.Extensions.Logging;
namespace CompanyManagment.Application;
@@ -37,7 +38,8 @@ public class PaymentCallbackHandler : IPaymentCallbackHandler
IFinancialInvoiceApplication financialInvoiceApplication,
IInstitutionContractApplication institutionContractApplication,
IHttpClientFactory httpClientFactory, IInstitutionContractRepository institutionContractRepository,
IFinancialStatmentRepository financialStatmentRepository)
IFinancialStatmentRepository financialStatmentRepository,
ILogger<SepehrPaymentGateway> sepehrGatewayLogger)
{
_paymentTransactionApplication = paymentTransactionApplication;
_financialStatmentApplication = financialStatmentApplication;
@@ -45,7 +47,7 @@ public class PaymentCallbackHandler : IPaymentCallbackHandler
_institutionContractApplication = institutionContractApplication;
_institutionContractRepository = institutionContractRepository;
_financialStatmentRepository = financialStatmentRepository;
_paymentGateway = new SepehrPaymentGateway(httpClientFactory);
_paymentGateway = new SepehrPaymentGateway(httpClientFactory, sepehrGatewayLogger);
}
/// <summary>

View File

@@ -7,6 +7,7 @@ using _0_Framework.Application;
using _0_Framework.Application.PaymentGateway;
using CompanyManagment.App.Contracts.PaymentTransaction;
using CompanyManagment.App.Contracts.SepehrPaymentGateway;
using Microsoft.Extensions.Logging;
namespace CompanyManagment.Application;
@@ -20,9 +21,10 @@ public class SepehrPaymentGatewayService : ISepehrPaymentGatewayService
public SepehrPaymentGatewayService(
IPaymentTransactionApplication paymentTransactionApplication,
IHttpClientFactory httpClientFactory)
IHttpClientFactory httpClientFactory,
ILogger<SepehrPaymentGateway> sepehrGatewayLogger)
{
_paymentGateway = new SepehrPaymentGateway(httpClientFactory);
_paymentGateway = new SepehrPaymentGateway(httpClientFactory, sepehrGatewayLogger);
_paymentTransactionApplication = paymentTransactionApplication;
}

View File

@@ -48,7 +48,8 @@ public class institutionContractController : AdminBaseController
IPersonalContractingPartyApp contractingPartyApplication, IContactInfoApplication contactInfoApplication,
IAccountApplication accountApplication, IEmployerApplication employerApplication,
IWorkshopApplication workshopApplication, ITemporaryClientRegistrationApplication temporaryClientRegistration,
ITemporaryClientRegistrationApplication clientRegistrationApplication, IHttpClientFactory httpClientFactory)
ITemporaryClientRegistrationApplication clientRegistrationApplication, IHttpClientFactory httpClientFactory
,ILogger<SepehrPaymentGateway> sepehrGatewayLogger)
{
_institutionContractApplication = institutionContractApplication;
_contractingPartyApplication = contractingPartyApplication;
@@ -58,7 +59,7 @@ public class institutionContractController : AdminBaseController
_workshopApplication = workshopApplication;
_temporaryClientRegistration = temporaryClientRegistration;
_clientRegistrationApplication = clientRegistrationApplication;
_paymentGateway = new SepehrPaymentGateway(httpClientFactory);
_paymentGateway = new SepehrPaymentGateway(httpClientFactory, sepehrGatewayLogger);
}
/// <summary>

View File

@@ -79,7 +79,8 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
CompanyContext context, AccountContext accountContext, IHttpClientFactory httpClientFactory,
IOptions<AppSettingConfiguration> appSetting,
ITemporaryClientRegistrationApplication clientRegistrationApplication, IOnlinePayment onlinePayment,
IFaceEmbeddingService faceEmbeddingService, IAuthHelper authHelper, IInstitutionContractApplication institutionContractApplication)
IFaceEmbeddingService faceEmbeddingService, IAuthHelper authHelper, IInstitutionContractApplication institutionContractApplication
,ILogger<SepehrPaymentGateway> sepehrGatewayLogger)
{
_application = application;
_rollCallDomainService = rollCallDomainService;
@@ -91,7 +92,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
_faceEmbeddingService = faceEmbeddingService;
_authHelper = authHelper;
_institutionContractApplication = institutionContractApplication;
_paymentGateway = new SepehrPaymentGateway(httpClientFactory);
_paymentGateway = new SepehrPaymentGateway(httpClientFactory, sepehrGatewayLogger);
}
public void OnGet()