Esempio n. 1
0
        public static IOnlinePaymentAccessor Configure()
        {
            return(ParbadBuilder.CreateDefaultBuilder()
                   .ConfigureGateways(gateways =>
            {
                gateways
                .AddMellat()
                .WithAccounts(accounts =>
                {
                    accounts.AddInMemory(account =>
                    {
                        account.Name = "Mellat";         // optional if there is only 1 account for this gateway
                        account.TerminalId = 123;
                        account.UserName = "******";
                        account.UserPassword = "******";
                    });
                });

                gateways
                .AddParbadVirtual()
                .WithOptions(options => options.GatewayPath = "/MyVirtualGateway");
            })
                   .ConfigureHttpContext(builder => builder.UseOwinFromCurrentHttpContext())
                   .ConfigureStorage(builder => builder.UseMemoryCache())
                   .Build()); // don't forget to call the build method. Otherwise you cannot use the StaticOnlinePayment class.
        }
Esempio n. 2
0
        public static IOnlinePaymentAccessor Configure()
        {
            return
                (ParbadBuilder.CreateDefaultBuilder()
                 .ConfigureGateways(gateways =>
            {
                gateways
                .AddMellat()
                .WithOptions(options =>
                {
                    options.TerminalId = 123;
                    options.UserName = "******";
                    options.UserPassword = "******";
                });

                gateways
                .AddParbadVirtual()
                .WithOptions(options => options.GatewayPath = "/virtual");
            })
                 // Uncomment the bellow code to use SQL Server instead of Memory.
                 //.ConfigureStorage(builder => builder.UseParbadSqlServer("Connection String"))
                 .ConfigureStorage(builder => builder.UseInMemoryDatabase("MyDatabase"))
                 .ConfigureHttpContext(builder => builder.UseOwinFromCurrentHttpContext())
                 .Build());   // don't forget to use the build method. Otherwise you cannot use the StaticOnlinePayment class.
        }
Esempio n. 3
0
        public static IParbadBuilder Configure()
        {
            return(ParbadBuilder.CreateDefaultBuilder()
                   .ConfigureGateways(gateways =>
            {
                gateways
                .AddMellat()
                .WithAccounts(accounts =>
                {
                    accounts.AddInMemory(account =>
                    {
                        account.Name = "Mellat";         // optional if there is only 1 account for this gateway
                        account.TerminalId = 123;
                        account.UserName = "******";
                        account.UserPassword = "******";
                    });
                });

                gateways
                .AddParbadVirtual()
                .WithOptions(options => options.GatewayPath = "/MyVirtualGateway");
            })
                   .ConfigureHttpContext(builder => builder.UseOwinFromCurrentHttpContext())
                   .ConfigureStorage(builder => builder.UseMemoryCache()));
        }
Esempio n. 4
0
        /// <summary>
        /// Adds Parbad pre-configured services to the specified <see cref="IServiceCollection"/>.
        /// </summary>
        public static IParbadBuilder AddParbad(this IServiceCollection services)
        {
            if (services == null)
            {
                throw new ArgumentNullException(nameof(services));
            }

            return(ParbadBuilder.CreateDefaultBuilder(services));
        }
Esempio n. 5
0
        public static IParbadBuilder Configure()
        {
            return
                (ParbadBuilder.CreateDefaultBuilder()
                 .ConfigureGateways(gateways =>
            {
                gateways
                .AddMellat()
                .WithOptionsProvider <MellatOptionsProvider>(ServiceLifetime.Transient);

                gateways
                .AddParbadVirtual()
                .WithOptions(options => options.GatewayPath = "/virtual");
            })
                 // Uncomment the bellow code to use SQL Server instead of Memory.
                 //.ConfigureStorage(builder => builder.UseParbadSqlServer("Connection String"))
                 .ConfigureStorage(builder => builder.UseInMemoryDatabase("MyDatabase"))
                 .ConfigureHttpContext(builder => builder.UseOwinFromCurrentHttpContext()));
        }