diff --git a/CompanyManagment.Application/InstitutionContractApplication.cs b/CompanyManagment.Application/InstitutionContractApplication.cs index e844c1ff..35a0159a 100644 --- a/CompanyManagment.Application/InstitutionContractApplication.cs +++ b/CompanyManagment.Application/InstitutionContractApplication.cs @@ -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 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) diff --git a/CompanyManagment.Application/PaymentCallbackHandler.cs b/CompanyManagment.Application/PaymentCallbackHandler.cs index 5bd85425..7a5185b4 100644 --- a/CompanyManagment.Application/PaymentCallbackHandler.cs +++ b/CompanyManagment.Application/PaymentCallbackHandler.cs @@ -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 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); } /// diff --git a/CompanyManagment.Application/SepehrPaymentGatewayService.cs b/CompanyManagment.Application/SepehrPaymentGatewayService.cs index dc9749cf..9790f66b 100644 --- a/CompanyManagment.Application/SepehrPaymentGatewayService.cs +++ b/CompanyManagment.Application/SepehrPaymentGatewayService.cs @@ -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 sepehrGatewayLogger) { - _paymentGateway = new SepehrPaymentGateway(httpClientFactory); + _paymentGateway = new SepehrPaymentGateway(httpClientFactory, sepehrGatewayLogger); _paymentTransactionApplication = paymentTransactionApplication; } diff --git a/ServiceHost/Areas/Admin/Controllers/institutionContractController.cs b/ServiceHost/Areas/Admin/Controllers/institutionContractController.cs index 24197909..cb0e2408 100644 --- a/ServiceHost/Areas/Admin/Controllers/institutionContractController.cs +++ b/ServiceHost/Areas/Admin/Controllers/institutionContractController.cs @@ -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 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); } /// diff --git a/ServiceHost/Areas/AdminNew/Pages/Company/AndroidApk/Index.cshtml.cs b/ServiceHost/Areas/AdminNew/Pages/Company/AndroidApk/Index.cshtml.cs index 660a659c..14c47181 100644 --- a/ServiceHost/Areas/AdminNew/Pages/Company/AndroidApk/Index.cshtml.cs +++ b/ServiceHost/Areas/AdminNew/Pages/Company/AndroidApk/Index.cshtml.cs @@ -79,7 +79,8 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk CompanyContext context, AccountContext accountContext, IHttpClientFactory httpClientFactory, IOptions appSetting, ITemporaryClientRegistrationApplication clientRegistrationApplication, IOnlinePayment onlinePayment, - IFaceEmbeddingService faceEmbeddingService, IAuthHelper authHelper, IInstitutionContractApplication institutionContractApplication) + IFaceEmbeddingService faceEmbeddingService, IAuthHelper authHelper, IInstitutionContractApplication institutionContractApplication + ,ILogger 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()