public CCCustomerInformationManager(string processingCenterID, CCProcessingFeature feature, ProcessingContext context)
 {
     _processingGraph    = PXGraph.CreateInstance <CCPaymentProcessing>();
     _processingCenterID = processingCenterID;
     _feature            = feature;
     Context             = context;
     _processingGraph.checkProcessing(_processingCenterID, _feature, Context);
 }
        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 void CheckProcessing(CCProcessingCenter processingCenter, CCProcessingFeature feature, CCProcessingContext newContext)
 {
     CheckProcessingCenter(processingCenter);
     newContext.processingCenter = processingCenter;
     if (feature != CCProcessingFeature.Base && !CCProcessingFeatureHelper.IsFeatureSupported(processingCenter, feature))
     {
         throw new PXException(Messages.FeatureNotSupportedByProcessing, feature.ToString());
     }
 }
        protected CCCustomerInformationManager(string processingCenterID, CCProcessingFeature feature)
        {
            _feature    = feature;
            _context    = new CCProcessingContext();
            _repository = CCPaymentProcessingRepository.GetCCPaymentProcessingRepository();
            CCProcessingCenter processingCenter = _repository.GetCCProcessingCenter(processingCenterID);

            CCProcessingFeatureHelper.CheckProcessing(processingCenter, _feature, _context);
            _pluginObject = InitializePlugin(_repository.GetCCProcessingCenter(processingCenterID));
        }
Ejemplo n.º 5
0
        public static bool IsFeatureSupported(PXGraph graph, int?PMInstanceID, CCProcessingFeature FeatureName)
        {
            CustomerPaymentMethod current = GetCustomerPaymentMethod(graph, PMInstanceID);

            if (current == null)
            {
                return(false);
            }
            CCProcessingCenter processingCenter = GetProcessingCenter(graph, current.CCProcessingCenterID);

            return(CCProcessingFeatureHelper.IsFeatureSupported(processingCenter, FeatureName));
        }
        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);
        }
            private T GetProcessor <T>(CCProcessingFeature feature = CCProcessingFeature.HostedForm) where T : class
            {
                V2SettingsGenerator seetingsGen = new V2SettingsGenerator(_provider);
                T processor = _plugin.CreateProcessor <T>(seetingsGen.GetSettings());

                if (processor == null)
                {
                    string errorMessage = PXMessages.LocalizeFormatNoPrefixNLA(
                        Messages.FeatureNotSupportedByProcessing,
                        CCProcessingFeature.HostedForm);
                    throw new PXException(errorMessage);
                }
                return(processor);
            }
        public static bool IsFeatureSupported(CCProcessingCenter ccProcessingCenter, CCProcessingFeature feature)
        {
            bool ret = false;

            if (ccProcessingCenter != null && !string.IsNullOrEmpty(ccProcessingCenter.ProcessingTypeName))
            {
                try
                {
                    Type procType = CCPluginTypeHelper.GetPluginTypeWithCheck(ccProcessingCenter);
                    ret = IsFeatureSupported(procType, feature);
                }
                catch
                {}
            }
            return(ret);
        }
Ejemplo n.º 9
0
        protected virtual bool IsFeatureSupported(string procCenterId, CCProcessingFeature feature)
        {
            bool ret = CCProcessingFeatureHelper.IsFeatureSupported(GetProcessingCenterById(procCenterId), CCProcessingFeature.PaymentHostedForm);

            return(ret);
        }
Ejemplo n.º 10
0
        public static bool IsFeatureSupported(PXGraph graph, int?PMInstanceID, CCProcessingFeature FeatureName, bool CheckJustDeletedPM = false)
        {
            CCProcessingCenter processingCenter = GetProcessingCenter(graph, PMInstanceID, CheckJustDeletedPM);

            return(CCProcessingFeatureHelper.IsFeatureSupported(processingCenter, FeatureName));
        }
Ejemplo n.º 11
0
 public CCProcessingCenterSelectorAttribute(CCProcessingFeature feature) : base(typeof(CCProcessingCenter.processingCenterID), typeof(CCProcessingCenter.processingCenterID))
 {
     this.feature = feature;
 }
 public static bool IsFeatureSupported(CCProcessingCenter ccProcessingCenter, CCProcessingFeature feature)
 {
     return(ccProcessingCenter != null && !string.IsNullOrEmpty(ccProcessingCenter.ProcessingTypeName) && IsFeatureSupported(PXBuildManager.GetType(ccProcessingCenter.ProcessingTypeName, true), feature));
 }