-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModule.cs
More file actions
45 lines (39 loc) · 1.52 KB
/
Copy pathModule.cs
File metadata and controls
45 lines (39 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using VirtoCommerce.Platform.Core.Modularity;
using VirtoCommerce.Payment.CCAvenue.Services;
using Serilog;
namespace VirtoCommerce.Payment.CCAvenue
{
public class Module : IModule, IHasConfiguration
{
public ManifestModuleInfo ModuleInfo { get; set; }
public void Initialize(IServiceCollection services)
{
// Core services
services.AddTransient<CCAvenuePaymentService>();
services.AddTransient<CCAvenueResponseHandler>();
services.AddTransient<CCAvenueTokenService>();
// Validators & processors
services.AddSingleton<CCAvenueChecksumValidator>();
services.AddSingleton<CCAvenueTimestampValidator>();
services.AddSingleton<CCAvenueCurrencyService>();
services.AddSingleton<CCAvenueBINProcessor>();
services.AddSingleton<PincodeValidator>();
services.AddSingleton<PincodeMetricsCollector>();
// Logging
Log.Logger = new LoggerConfiguration()
.WriteTo.Console()
.WriteTo.File("Logs/ccavenue.log", rollingInterval: RollingInterval.Day)
.CreateLogger();
}
public void PostInitialize(IApplicationBuilder appBuilder)
{
// Optional: configure middleware or endpoints here if needed
}
public void Uninstall()
{
// Optional: cleanup logic if required
}
}
}