public static bool IsFeatureSupported(Type pluginType, CCProcessingFeature feature)
        {
            bool result = false;

            if (typeof(V1.ICCPaymentProcessing).IsAssignableFrom(pluginType))
            {
                switch (feature)
                {
                case CCProcessingFeature.ProfileManagement:
                    result = typeof(V1.ICCTokenizedPaymentProcessing).IsAssignableFrom(pluginType);
                    break;

                case CCProcessingFeature.HostedForm:
                    result = typeof(V1.ICCProcessingHostedForm).IsAssignableFrom(pluginType);
                    break;

                case CCProcessingFeature.ExtendedProfileManagement:
                    result = false;
                    break;

                default:
                    result = false;
                    break;
                }
            }
            else if (typeof(V2.ICCProcessingPlugin).IsAssignableFrom(pluginType))
            {
                V2.ICCProcessingPlugin plugin = (V2.ICCProcessingPlugin)Activator.CreateInstance(pluginType);
                object processorInstnace      = null;
                try
                {
                    switch (feature)
                    {
                    case CCProcessingFeature.ProfileManagement:
                        processorInstnace = plugin.CreateProcessor <V2.ICCProfileProcessor>(null);
                        break;

                    case CCProcessingFeature.HostedForm:
                        processorInstnace = plugin.CreateProcessor <V2.ICCHostedFormProcessor>(null);
                        break;

                    case CCProcessingFeature.ExtendedProfileManagement:
                        processorInstnace = plugin.CreateProcessor <V2.ICCProfileProcessor>(null);
                        break;

                    default:
                        break;
                    }
                    result = processorInstnace != null;
                }
                catch
                {
                    //ignoring any initialization errors!
                    result = true;
                }
            }
            return(result);
        }
        public static bool IsFeatureSupported(Type pluginType, CCProcessingFeature feature)
        {
            bool result = false;

            if (typeof(V2.ICCProcessingPlugin).IsAssignableFrom(pluginType))
            {
                V2.ICCProcessingPlugin plugin       = (V2.ICCProcessingPlugin)Activator.CreateInstance(pluginType);
                Func <object>[]        checkFuncArr = null;
                switch (feature)
                {
                case CCProcessingFeature.ProfileManagement:
                    checkFuncArr = new Func <object>[] { () => plugin.CreateProcessor <V2.ICCProfileProcessor>(null) };
                    break;

                case CCProcessingFeature.HostedForm:
                    checkFuncArr = new Func <object>[] { () => plugin.CreateProcessor <V2.ICCHostedFormProcessor>(null) };
                    break;

                case CCProcessingFeature.ExtendedProfileManagement:
                    checkFuncArr = new Func <object>[] { () => plugin.CreateProcessor <V2.ICCProfileProcessor>(null) };
                    break;

                case CCProcessingFeature.PaymentHostedForm:
                    checkFuncArr = new Func <object>[] {
                        () => plugin.CreateProcessor <V2.ICCHostedPaymentFormProcessor>(null),
                        () => plugin.CreateProcessor <V2.ICCTransactionGetter>(null),
                        () => plugin.CreateProcessor <V2.ICCProfileCreator>(null),
                        () => plugin.CreateProcessor <V2.ICCHostedPaymentFormResponseParser>(null)
                    };
                    break;

                case CCProcessingFeature.WebhookManagement:
                    checkFuncArr = new Func <object>[] {
                        () => plugin.CreateProcessor <V2.ICCWebhookProcessor>(null),
                        () => plugin.CreateProcessor <V2.ICCWebhookResolver>(null)
                    };
                    break;

                case CCProcessingFeature.TransactionGetter:
                    checkFuncArr = new Func <object>[] { () => plugin.CreateProcessor <V2.ICCTransactionGetter>(null) };
                    break;
                }

                if (checkFuncArr != null)
                {
                    result = checkFuncArr.All(f => CheckV2TypeWrapper(f));
                }
            }

            return(result);
        }
Example #3
0
 public V2BaseProfileProcessor(V2.ICCProcessingPlugin v2Plugin, Repositories.ICardProcessingReadersProvider provider)
 {
     _plugin    = v2Plugin;
     _provider  = provider;
     _processor = GetProcessor();
 }
 public V2ExtendedProfileProcessor(V2.ICCProcessingPlugin v2Plugin)
 {
     _plugin = v2Plugin;
 }
Example #5
0
 public V2HostedFormProcessor(V2.ICCProcessingPlugin v2Plugin, ICardProcessingReadersProvider provider)
 {
     _plugin   = v2Plugin;
     _provider = provider;
 }
 public V2HostedFormProcessor(V2.ICCProcessingPlugin v2Plugin)
 {
     _plugin = v2Plugin;
 }
 public V2CardTransactionProcessor(V2.ICCProcessingPlugin v2Plugin)
 {
     _plugin = v2Plugin;
 }
 public V2ExtendedProfileProcessor(V2.ICCProcessingPlugin v2Plugin, Repositories.ICardProcessingReadersProvider provider)
 {
     _plugin   = v2Plugin;
     _provider = provider;
 }
 public V2CardTransactionProcessor(V2.ICCProcessingPlugin v2Plugin, Repositories.ICardProcessingReadersProvider provider)
 {
     _plugin   = v2Plugin;
     _provider = provider;
 }
Example #10
0
 public V2BaseProfileProcessor(V2.ICCProcessingPlugin v2Plugin)
 {
     _plugin = v2Plugin;
 }