Example #1
0
        static ParbadConfiguration()
        {
            Gateways = new GatewaysConfiguration();

            Storage = new TemporaryMemoryStorage(TemporaryMemoryStorage.DefaultInvoiceLifetime);

            Logger = new LoggerSettings();
        }
        internal static IranKishGatewayConfiguration GetIranKishGatewayConfiguration(this GatewaysConfiguration gatewayConfiguration)
        {
            if (gatewayConfiguration == null)
            {
                throw new ArgumentNullException(nameof(gatewayConfiguration));
            }

            return(gatewayConfiguration.GetGatewayConfiguration <IranKishGatewayConfiguration>(Gateway.IranKish));
        }
        internal static TejaratGatewayConfiguration GetTejaratGatewayConfiguration(this GatewaysConfiguration gatewayConfiguration)
        {
            if (gatewayConfiguration == null)
            {
                throw new ArgumentNullException(nameof(gatewayConfiguration));
            }

            return(gatewayConfiguration.GetGatewayConfiguration <TejaratGatewayConfiguration>(Gateway.Tejarat));
        }
        internal static SamanGatewayConfiguration GetSamanGatewayConfiguration(this GatewaysConfiguration gatewayConfiguration)
        {
            if (gatewayConfiguration == null)
            {
                throw new ArgumentNullException(nameof(gatewayConfiguration));
            }

            return(gatewayConfiguration.GetGatewayConfiguration <SamanGatewayConfiguration>(Gateway.Saman));
        }
        internal static PasargadGatewayConfiguration GetPasargadGatewayConfiguration(this GatewaysConfiguration gatewayConfiguration)
        {
            if (gatewayConfiguration == null)
            {
                throw new ArgumentNullException(nameof(gatewayConfiguration));
            }

            return(gatewayConfiguration.GetGatewayConfiguration <PasargadGatewayConfiguration>(Gateway.Pasargad));
        }
 internal static TConfiguration GetGatewayConfiguration <TConfiguration>(this GatewaysConfiguration configuration, Gateway gateway) where TConfiguration : class
 {
     return(configuration.GetGatewayConfiguration(gateway) as TConfiguration);
 }
 internal static bool IsGatewayConfigured(this GatewaysConfiguration configuration, Gateway gateway)
 {
     return(configuration.GetGatewayConfiguration(gateway) != null);
 }