public static bool IsHFPaymentMethod(PXGraph graph, int?PMInstanceID, bool CheckJustDeletedPM = false)
        {
            CCProcessingCenter processingCenter = GetProcessingCenter(graph, PMInstanceID, CheckJustDeletedPM);

            return(CCProcessingFeatureHelper.IsFeatureSupported(processingCenter, CCProcessingFeature.HostedForm) &&
                   (processingCenter.AllowDirectInput != true));
        }
 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());
     }
 }
        public static bool?CCProcessingCenterNeedsExpDateUpdate(PXGraph graph, CCProcessingCenter ProcessingCenter)
        {
            if (CCProcessingFeatureHelper.IsFeatureSupported(ProcessingCenter, CCProcessingFeature.ProfileManagement))
            {
                PXResultset <CustomerPaymentMethod> unupdatedCpms = PXSelect <CustomerPaymentMethod, Where <CustomerPaymentMethod.cCProcessingCenterID,
                                                                                                            Equal <Required <CustomerPaymentMethod.cCProcessingCenterID> >, And <CustomerPaymentMethod.expirationDate, IsNull> > > .Select(graph, ProcessingCenter.ProcessingCenterID);

                return(unupdatedCpms.Count != 0);
            }
            return(null);
        }
Exemple #4
0
        public static bool IsHFPaymentMethod(PXGraph graph, int?PMInstanceID)
        {
            CustomerPaymentMethod current = GetCustomerPaymentMethod(graph, PMInstanceID);

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

            return(CCProcessingFeatureHelper.IsFeatureSupported(processingCenter, CCProcessingFeature.HostedForm) && (processingCenter.AllowDirectInput != true));
        }
Exemple #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 string GetTokenizedPMsString(PXGraph graph)
        {
            List <CCProcessingCenter> tokenizedPCs = new List <CCProcessingCenter>();
            HashSet <string>          pmSet        = new HashSet <string>();

            foreach (CCProcessingCenter pc in PXSelect <CCProcessingCenter, Where <CCProcessingCenter.isActive, Equal <True> > > .Select(graph))
            {
                if (CCProcessingFeatureHelper.IsFeatureSupported(pc, CCProcessingFeature.ProfileManagement) &&
                    CCProcessingCenterNeedsExpDateUpdate(graph, pc) != false)
                {
                    tokenizedPCs.Add(pc);
                }
            }

            foreach (CCProcessingCenter pc in tokenizedPCs)
            {
                foreach (PXResult <CustomerPaymentMethod, PaymentMethod> tokenizedPM in PXSelectJoinGroupBy <CustomerPaymentMethod,
                                                                                                             InnerJoin <PaymentMethod, On <CustomerPaymentMethod.paymentMethodID, Equal <PaymentMethod.paymentMethodID> > >,
                                                                                                             Where <CustomerPaymentMethod.cCProcessingCenterID, Equal <Required <CustomerPaymentMethod.cCProcessingCenterID> > >,
                                                                                                             Aggregate <GroupBy <CustomerPaymentMethod.paymentMethodID> > > .Select(graph, pc.ProcessingCenterID))
                {
                    PaymentMethod pm = tokenizedPM;
                    pmSet.Add(pm.Descr);
                }
            }

            if (pmSet.Count == 0)
            {
                return(string.Empty);
            }

            StringBuilder sb = new StringBuilder();

            foreach (string descr in pmSet)
            {
                if (sb.Length > 0)
                {
                    sb.Append(", ");
                }
                sb.Append(descr);
            }

            return(sb.ToString());
        }
        public static bool IsFeatureSupported(PXGraph graph, int?PMInstanceID, CCProcessingFeature FeatureName, bool CheckJustDeletedPM = false)
        {
            CCProcessingCenter processingCenter = GetProcessingCenter(graph, PMInstanceID, CheckJustDeletedPM);

            return(CCProcessingFeatureHelper.IsFeatureSupported(processingCenter, FeatureName));
        }