You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

44 lines
1.5 KiB

using Common.TPService;
using Common.Utility;
using GMENepal.GMENepalAPIService;
using log4net;
using TPApiServices.GuavaPayRemit.Services;
using TPApiServices.SendMNRemit.Services;
using TPService.GCC.Services;
using Unity;
namespace Business.BusinessLogic.TPApiServices.Factory
{
public class ApiFactoryServices : IApiFactoryServices
{
private readonly ILog log = LogManager.GetLogger(typeof(ApiFactoryServices));
private readonly UnityContainer _container = new UnityContainer();
private ITPApiServices apiFactory;
public ITPApiServices GetServices(string providerNo)
{
if (providerNo == GetStatic.ReadWebConfig("gmenepal", ""))
{
log.Debug("Choose Provider as GMENepalAPI");
apiFactory = _container.Resolve<GMENepalAPI>();
}
else if (providerNo == GetStatic.ReadWebConfig("gccremit", ""))
{
log.Debug("Choose Provider as GCC ");
apiFactory = _container.Resolve<GCCAPI>();
}
else if (providerNo == GetStatic.ReadWebConfig("sendMN", ""))
{
log.Debug("Choose Provider as SENDMN ");
apiFactory = _container.Resolve<SendMNAPI>();
}
else if (providerNo == GetStatic.ReadWebConfig("guavaPay", ""))
{
log.Debug("Choose Provider as guavaPay");
apiFactory = _container.Resolve<GuavaPayAPI>();
}
return apiFactory;
}
}
}