private bool ProcCenterSupportTokenizing(string procCenterId)
		{
			var query = new PXSelect<CCProcessingCenter,
				Where<CCProcessingCenter.processingCenterID, Equal<Required<CCProcessingCenter.processingCenterID>>>>(this);
			CCProcessingCenter procCenter = query.Select(procCenterId);
			string typeName = procCenter.ProcessingTypeName;
			if (typeName == AuthnetConstants.AIMPluginFullName)
			{
				return false;
			}
			if (typeName == AuthnetConstants.CIMPluginFullName || 
				typeName == AuthnetConstants.APIPluginFullName)
			{
				return true;
			}
			Type type = CCPluginTypeHelper.GetPluginType(procCenter.ProcessingTypeName);
			if (CCPluginTypeHelper.CheckImplementInterface(type, PluginConstants.V1TokenizedInterface))
			{
				return true;
			}
			if (CCProcessingFeatureHelper.IsFeatureSupported(type, CCProcessingFeature.ProfileManagement))
			{
				return true;
			}
			return false;
		}
Пример #2
0
        private bool CheckPluginType(CCProcessingCenter procCenter)
        {
            string pluginTypeName = procCenter.ProcessingTypeName;
            bool   res            = pluginTypeNames.Contains(pluginTypeName);

            if (res)
            {
                return(true);
            }

            try
            {
                Type pluginType = CCPluginTypeHelper.GetPluginType(pluginTypeName);
                foreach (string typeName in pluginTypeNames)
                {
                    res = CCPluginTypeHelper.CheckParentClass(pluginType, typeName, 0, 3) ||
                          CCPluginTypeHelper.CheckImplementInterface(pluginType, typeName);
                    if (res)
                    {
                        return(true);
                    }
                }
            }
            catch { }
            return(false);
        }
Пример #3
0
        public static bool IsProcessingCenterNotSupported(PXGraph graph, int?pmInstanceID)
        {
            if (pmInstanceID == null)
            {
                return(false);
            }
            CCProcessingCenter processingCenter = GetProcessingCenterByPMInstance(graph, pmInstanceID);

            if (processingCenter == null)
            {
                return(false);
            }
            return(CCPluginTypeHelper.IsUnsupportedPluginType(processingCenter?.ProcessingTypeName));
        }
Пример #4
0
        public static bool IsProcessingCenterNotSupported(PXGraph graph, string procCenterId)
        {
            if (procCenterId == null)
            {
                return(false);
            }
            CCProcessingCenter processingCenter = PXSelect <CCProcessingCenter,
                                                            Where <CCProcessingCenter.processingCenterID, Equal <Required <CCProcessingCenter.processingCenterID> > > >
                                                  .Select(graph, procCenterId);

            if (processingCenter == null)
            {
                return(false);
            }
            return(CCPluginTypeHelper.IsUnsupportedPluginType(processingCenter.ProcessingTypeName));
        }
Пример #5
0
        public void RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            if (e.Row == null)
            {
                return;
            }

            string name = this.FieldName;
            object val  = sender.GetValue(e.Row, name);

            if (ChckVal == CheckVal.PmInstanceId)
            {
                int?id = val as int?;
                if (id != null && id > 0 && IsProcessingCenterNotSupported(sender.Graph, id))
                {
                    CCProcessingCenter procCenter = GetProcessingCenterByPMInstance(sender.Graph, id);
                    sender.RaiseExceptionHandling(name, e.Row, id, new PXSetPropertyException(AR.Messages.PaymentProfileProcCenterNotSupported, PXErrorLevel.Warning, procCenter?.ProcessingCenterID));
                    errorRised = true;
                }
                else
                {
                    if (errorRised)
                    {
                        sender.RaiseExceptionHandling(name, e.Row, null, null);
                        errorRised = false;
                    }
                }
            }

            if (ChckVal == CheckVal.ProcessingCenterId)
            {
                string procCenterId = val as string;
                if (procCenterId != null && IsProcessingCenterNotSupported(sender.Graph, procCenterId))
                {
                    sender.RaiseExceptionHandling(name, e.Row, procCenterId, new PXSetPropertyException(AR.Messages.PaymentProfileProcCenterNotSupported, PXErrorLevel.Warning, procCenterId));
                    errorRised = true;
                }
                else
                {
                    if (errorRised)
                    {
                        sender.RaiseExceptionHandling(name, e.Row, null, null);
                        errorRised = false;
                    }
                }
            }

            if (ChckVal == CheckVal.ProcessingCenterType)
            {
                string typeStr = val as string;
                if (typeStr != null && CCPluginTypeHelper.IsUnsupportedPluginType(typeStr))
                {
                    sender.RaiseExceptionHandling(name, e.Row, typeStr, new PXSetPropertyException(CA.Messages.NotSupportedProcCenter, PXErrorLevel.Warning));
                    errorRised = true;
                }
                else
                {
                    if (errorRised)
                    {
                        sender.RaiseExceptionHandling(name, e.Row, null, null);
                        errorRised = false;
                    }
                }
            }
        }
Пример #6
0
        private object GetProcessorPlugin(CCProcessingCenter processingCenter)
        {
            object plugin = CCPluginTypeHelper.CreatePluginInstance(processingCenter);

            return(plugin);
        }