Esempio n. 1
0
        public async Task CanGenerateTransactionReference()
        {
            HostingEnvironment hostEnvironment = new HostingEnvironment();

            hostEnvironment.ContentRootPath         = "C:\\Users\\LENOVO\\Documents\\Repositories\\lms-gateway\\src\\Presentation\\LmsGateway.Web";
            hostEnvironment.ContentRootFileProvider = new PhysicalFileProvider(hostEnvironment.ContentRootPath);
            hostEnvironment.EnvironmentName         = "Development";

            Startup           startup = new Web.Startup(hostEnvironment);
            ServiceCollection sc      = new ServiceCollection();

            startup.ConfigureServices(sc);

            IServiceProvider       serviceProvider       = sc.BuildServiceProvider();
            ITransactionLogService transactionLogService = serviceProvider.GetService <ITransactionLogService>();
            IGatewayLuncher        gatewayLuncher        = serviceProvider.GetService <IGatewayLuncher>();
            ISettingService        settingService        = serviceProvider.GetService <ISettingService>();
            IWidgetProvider        widgetProvider        = serviceProvider.GetService <IWidgetProvider>();

            var transactionRef = new TransactionReference(transactionLogService, gatewayLuncher, settingService, widgetProvider);
            var response       = await transactionRef.InvokeAsync();

            var result = (ViewViewComponentResult)response;

            //Assert.NotNull(result);
            //Assert.NotNull(response);
            //Assert.IsType<ViewViewComponentResult>(response);
            //Assert.IsType<string>(result.ViewData.Model);
        }
Esempio n. 2
0
        public PaystackController(ITransactionStatusService transactionStatusService
                                  , ISupportedCurrencyService supportedCurrencyService
                                  , IHostingEnvironment env
                                  , IGatewayLuncher gatewayLuncher
                                  //, HttpContext httpContext
                                  , ITransactionLogService transactionLogService
                                  , IHttpContextAccessor httpContextAccessor
                                  , ISettingService settingService)
        {
            Guard.NotNull(env, nameof(env));
            //Guard.NotNull(httpContext, nameof(httpContext));
            Guard.NotNull(settingService, nameof(settingService));
            Guard.NotNull(gatewayLuncher, nameof(gatewayLuncher));
            Guard.NotNull(transactionLogService, nameof(transactionLogService));
            Guard.NotNull(transactionStatusService, nameof(transactionStatusService));
            Guard.NotNull(supportedCurrencyService, nameof(supportedCurrencyService));
            Guard.NotNull(httpContextAccessor, nameof(httpContextAccessor));


            _hostEnvironment = env;

            _settingService           = settingService;
            _gatewayLuncher           = gatewayLuncher;
            _transactionLogService    = transactionLogService;
            _transactionStatusService = transactionStatusService;
            _supportedCurrencyService = supportedCurrencyService;
            _httpContext = httpContextAccessor.HttpContext;
        }
Esempio n. 3
0
        public PaystackProvider(IGatewayLuncher gatewayLuncher,
                                ISupportedCurrencyService supportedCurrencyService,
                                ITransactionLogService transactionLogService,
                                ISettingService settingService)
        {
            Guard.NotNull(settingService, nameof(settingService));
            Guard.NotNull(gatewayLuncher, nameof(gatewayLuncher));
            Guard.NotNull(supportedCurrencyService, nameof(supportedCurrencyService));
            Guard.NotNull(transactionLogService, nameof(transactionLogService));

            _settingService           = settingService;
            _gatewayLuncher           = gatewayLuncher;
            _supportedCurrencyService = supportedCurrencyService;
            _transactionLogService    = transactionLogService;

            _metadata = new PaymentMetadata()
            {
                Name       = "Paystack",
                SystemName = "LmsGateway.Paystack",
                Author     = "Daniel Egenti",
                IsActive   = true,
                Version    = "1.0.0",
                Category   = "Payments",
                Company    = "Nitware Solutions Ltd.",
                Website    = "http://www.nitware.com.ng"
            };
        }
Esempio n. 4
0
 public CardProvider(HttpContextBase httpContext, IGatewayLuncher gatewayLuncher, IGTPayCurrencyService supportedCurrencyService, ILocalizationService localizationService)
 {
     _httpContext              = httpContext;
     _gatewayLuncher           = gatewayLuncher;
     _supportedCurrencyService = supportedCurrencyService;
     _localizationService      = localizationService;
 }
Esempio n. 5
0
        public PaystackRegistrationCompletedFilter(IWidgetProvider widgetProvider, IGatewayLuncher gatewayLuncher)
        {
            Guard.NotNull(gatewayLuncher, nameof(gatewayLuncher));
            Guard.NotNull(widgetProvider, nameof(widgetProvider));

            _gatewayLuncher = gatewayLuncher;
            _widgetProvider = widgetProvider;
        }
 public OrderDetailsWidgetZoneFilter(
     Lazy <HttpContextBase> httpContext,
     Lazy <IWidgetProvider> widgetProvider,
     IGatewayLuncher gatewayLuncher)
 {
     _httpContext    = httpContext;
     _widgetProvider = widgetProvider;
     _gatewayLuncher = gatewayLuncher;
 }
Esempio n. 7
0
        public TransactionReference(ITransactionLogService transactionLogService, IGatewayLuncher gatewayLuncher, ISettingService settingService, IWidgetProvider widgetProvider)
        {
            Guard.NotNull(widgetProvider, nameof(widgetProvider));
            Guard.NotNull(settingService, nameof(settingService));
            Guard.NotNull(gatewayLuncher, nameof(gatewayLuncher));
            Guard.NotNull(transactionLogService, nameof(transactionLogService));

            _widgetProvider        = widgetProvider;
            _settingService        = settingService;
            _gatewayLuncher        = gatewayLuncher;
            _transactionLogService = transactionLogService;
        }
Esempio n. 8
0
        public GatewayHappyResponse(ITransactionLogService transactionLogService,
                                    IGatewayLuncher gatewayLuncher,
                                    ISettingService settingService,
                                    IWidgetProvider widgetProvider,
                                    IHttpContextAccessor httpContextAccessor)
        {
            Guard.NotNull(widgetProvider, nameof(widgetProvider));
            Guard.NotNull(settingService, nameof(settingService));
            Guard.NotNull(gatewayLuncher, nameof(gatewayLuncher));
            Guard.NotNull(transactionLogService, nameof(transactionLogService));
            Guard.NotNull(httpContextAccessor, nameof(httpContextAccessor));

            _widgetProvider        = widgetProvider;
            _settingService        = settingService;
            _gatewayLuncher        = gatewayLuncher;
            _transactionLogService = transactionLogService;
            _httpContext           = httpContextAccessor.HttpContext;
        }
Esempio n. 9
0
        public async Task c()
        {
            HostingEnvironment hostEnvironment = new HostingEnvironment();

            hostEnvironment.ContentRootPath         = "C:\\Users\\LENOVO\\Documents\\Repositories\\lms-gateway\\src\\Presentation\\LmsGateway.Web";
            hostEnvironment.ContentRootFileProvider = new PhysicalFileProvider(hostEnvironment.ContentRootPath);
            hostEnvironment.EnvironmentName         = "Development";

            Startup            startup = new Web.Startup(hostEnvironment);
            IServiceCollection sc      = new ServiceCollection();

            startup.ConfigureServices(sc);

            IServiceProvider          serviceProvider          = sc.BuildServiceProvider();
            ISupportedCurrencyService supportedCurrencyService = serviceProvider.GetService <ISupportedCurrencyService>();
            IGatewayLuncher           gatewayLuncher           = serviceProvider.GetService <IGatewayLuncher>();
            ITransactionLogService    transactionLogService    = serviceProvider.GetService <ITransactionLogService>();
            ITransactionStatusService transactionStatusService = serviceProvider.GetService <ITransactionStatusService>();
            ISettingService           settingService           = serviceProvider.GetService <ISettingService>();

            //PaystackController paystackController = new PaystackController(transactionStatusService
            //    , supportedCurrencyService
            //    , hostEnvironment
            //    , gatewayLuncher
            //    , transactionLogService
            //    , settingService);

            //var response = await paystackController.InvokeAsync();
            //var result = (ViewViewComponentResult)response;

            //Assert.NotNull(result);
            //Assert.NotNull(response);
            //Assert.IsType<ViewViewComponentResult>(response);
            //Assert.IsType<PaymentInfoModel>(result.ViewData.Model);
            //Assert.True((result.ViewData.Model as PaymentInfoModel).IconUrl != null);
        }