/// <summary>
        /// Adds IranKish gateway to Parbad services.
        /// </summary>
        /// <param name="builder"></param>
        public static IGatewayConfigurationBuilder <IranKishGateway> AddIranKish(this IGatewayBuilder builder)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            return(builder.AddGateway <IranKishGateway>(new Uri(IranKishHelper.BaseServiceUrl)));
        }
        /// <summary>
        /// Adds <see cref="FanAvaGateway"/> to Parbad services.
        /// </summary>
        /// <param name="builder"></param>
        public static IGatewayConfigurationBuilder<FanAvaGateway> AddFanAva(this IGatewayBuilder builder)
        {
            if (builder == null) throw new ArgumentNullException(nameof(builder));

            return builder
                .AddGateway<FanAvaGateway>()
                .WithHttpClient(clientBuilder => { })
                .WithOptions(options => { });
        }
        /// <summary>
        /// Adds Parsian gateway to Parbad services.
        /// </summary>
        /// <param name="builder"></param>
        public static IGatewayConfigurationBuilder <ParsianGateway> AddParsian(this IGatewayBuilder builder)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            return(builder.AddGateway <ParsianGateway>(new Uri(ParsianHelper.BaseServiceUrl)));
        }
Пример #4
0
        /// <summary>
        /// Adds AsanPardakht gateway to Parbad services.
        /// </summary>
        /// <param name="builder"></param>
        public static IGatewayConfigurationBuilder <AsanPardakhtGateway> AddAsanPardakht(this IGatewayBuilder builder)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            return(builder.AddGateway <AsanPardakhtGateway>(new Uri(AsanPardakhtHelper.BaseServiceUrl)));
        }
        /// <summary>
        /// Adds the ZarinPal gateway to Parbad services.
        /// </summary>
        /// <param name="builder"></param>
        public static IGatewayConfigurationBuilder <ZarinPalGateway> AddZarinPal(this IGatewayBuilder builder)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            return(builder.AddGateway <ZarinPalGateway>());
        }
Пример #6
0
        /// <summary>
        /// Adds IranKish gateway to Parbad services.
        /// </summary>
        /// <param name="builder"></param>
        public static IGatewayConfigurationBuilder <IranKishGateway> AddIranKish(this IGatewayBuilder builder)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            return(builder.AddGateway <IranKishGateway>()
                   .WithHttpClient(clientBuilder => clientBuilder.ConfigureHttpClient(client =>
                                                                                      client.BaseAddress = new Uri(IranKishHelper.BaseServiceUrl))));
        }
        /// <summary>
        /// Adds Melli gateway to Parbad services.
        /// </summary>
        /// <param name="builder"></param>
        public static IGatewayConfigurationBuilder <MelliGateway> AddMelli(this IGatewayBuilder builder)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            builder.AddGatewayAccountProvider <MelliGatewayAccount>();

            return(builder.AddGateway <MelliGateway>(new Uri(MelliHelper.BaseServiceUrl)));
        }
        /// <summary>
        /// Adds the YekPay gateway to Parbad services.
        /// </summary>
        /// <param name="builder"></param>
        public static IGatewayConfigurationBuilder <YekPayGateway> AddYekPay(this IGatewayBuilder builder)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            return(builder.AddGateway <YekPayGateway>()
                   .WithHttpClient(clientBuilder =>
                                   clientBuilder.ConfigureHttpClient(client => client.BaseAddress = new Uri(YekPayHelper.ApiBaseUrl))));
        }
        /// <summary>
        /// Adds Parsian gateway to Parbad services.
        /// </summary>
        /// <param name="builder"></param>
        public static IGatewayConfigurationBuilder <ParsianGateway> AddParsian(this IGatewayBuilder builder)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            return(builder
                   .AddGateway <ParsianGateway>()
                   .WithHttpClient(clientBuilder => { })
                   .WithOptions(options => { }));
        }
        /// <summary>
        /// Adds the Parbad Virtual Gateway to Parbad services.
        /// </summary>
        /// <param name="builder"></param>
        public static IGatewayConfigurationBuilder <ParbadVirtualGateway> AddParbadVirtual(this IGatewayBuilder builder)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            builder.Services.TryAddTransient <IParbadVirtualGatewayMiddlewareInvoker, ParbadVirtualGatewayMiddlewareInvoker>();

            return(builder
                   .AddGateway <ParbadVirtualGateway>()
                   .WithAccounts(accounts => accounts.AddInMemory(account => { })));
        }
        /// <summary>
        /// Adds AsanPardakht gateway to Parbad services.
        /// </summary>
        /// <param name="builder"></param>
        public static IGatewayConfigurationBuilder <AsanPardakhtGateway> AddAsanPardakht(this IGatewayBuilder builder)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            builder.Services.AddSingleton <IAsanPardakhtCrypto, AsanPardakhtCrypto>();

            return(builder
                   .AddGateway <AsanPardakhtGateway>()
                   .WithOptions(options => { })
                   .WithHttpClient(clientBuilder => clientBuilder.ConfigureHttpClient(client => { })));
        }
        /// <summary>
        /// Adds Melli gateway to Parbad services.
        /// </summary>
        /// <param name="builder"></param>
        public static IGatewayConfigurationBuilder <MelliGateway> AddMelli(this IGatewayBuilder builder)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            builder.Services.AddSingleton <IMelliGatewayCrypto, MelliGatewayCrypto>();

            return(builder
                   .AddGateway <MelliGateway>()
                   .WithHttpClient(clientBuilder => { })
                   .WithOptions(options => { }));
        }