Beispiel #1
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;
        }
Beispiel #2
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"
            };
        }
Beispiel #3
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);
        }