Exemplo n.º 1
0
        private void ConvertCustomerPaymentMethod(CustomerPaymentMethod cpm, CCProcessingCenter newCCPC)
        {
            if (newCCPC == null)
            {
                throw new PXException("New Processing Center is not set!");
            }
            if (!CCPaymentProcessing.IsFeatureSupported(newCCPC, CCProcessingFeature.Tokenization))
            {
                throw new PXException("New processing center should support tokenization!");
            }
            PaymentMethodUpdater updaterGreph = PXGraph.CreateInstance <PaymentMethodUpdater>();

            updaterGreph.ConvertCustomerPaymentMethod(cpm, newCCPC);
        }
Exemplo n.º 2
0
        private void ConvertCustomerPaymentMethod(CustomerPaymentMethod cpm, CCProcessingCenter newCCPC)
        {
            if (newCCPC == null)
            {
                throw new PXException(Messages.NotSetProcessingCenter);
            }
            if (!CCPaymentProcessing.IsFeatureSupported(newCCPC, CCProcessingFeature.Tokenization))
            {
                throw new PXException(Messages.ProcessingCenterShouldTokenization);
            }
            PaymentMethodUpdater updaterGreph = PXGraph.CreateInstance <PaymentMethodUpdater>();

            updaterGreph.ConvertCustomerPaymentMethod(cpm, newCCPC);
        }
Exemplo n.º 3
0
        protected virtual void CCProcessingCenter_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            PXUIFieldAttribute.SetEnabled <CCProcessingCenter.processingTypeName>(sender, e.Row, (bool)((CCProcessingCenter)e.Row).IsActive);
            PXUIFieldAttribute.SetRequired <CCProcessingCenter.processingTypeName>(sender, (bool)((CCProcessingCenter)e.Row).IsActive);
            CCProcessingCenter row = (CCProcessingCenter)e.Row;
            bool isTokenized       = CCPaymentProcessing.IsFeatureSupported(row, CCProcessingFeature.HostedForm);

            PXUIFieldAttribute.SetVisible <CCProcessingCenter.allowDirectInput>(sender, row, isTokenized);
            PXUIFieldAttribute.SetVisible <CCProcessingCenter.syncronizeDeletion>(sender, row, isTokenized);
            PXUIFieldAttribute.SetVisible <CCProcessingCenter.syncRetryAttemptsNo>(sender, row, isTokenized);
            PXUIFieldAttribute.SetVisible <CCProcessingCenter.syncRetryDelayMs>(sender, row, isTokenized);
            this.testCredentials.SetEnabled((row != null) && !string.IsNullOrEmpty(row.ProcessingCenterID) && !string.IsNullOrEmpty(row.ProcessingTypeName));
            this.updateExpirationDate.SetVisible(row != null && row.NeedsExpDateUpdate == true);
            this.ProcessingCenter.Cache.AllowDelete = !HasTransactions((CCProcessingCenter)e.Row);
            PaymentMethods.AllowInsert = false;
            PaymentMethods.AllowDelete = false;
        }
Exemplo n.º 4
0
        protected virtual void CCProcessingCenter_ProcessingTypeName_FieldUpdated(PXCache sender, PXFieldUpdatedEventArgs e)
        {
            CCProcessingCenter row = e.Row as CCProcessingCenter;

            if (row == null)
            {
                return;
            }
            bool isTokenized = CCPaymentProcessing.IsFeatureSupported(row, CCProcessingFeature.Tokenization);
            bool isHF        = CCPaymentProcessing.IsFeatureSupported(row, CCProcessingFeature.HostedForm);

            sender.SetValue <CCProcessingCenter.allowDirectInput>(row, isTokenized && !isHF);
            foreach (CCProcessingCenterDetail detail in Details.Select())
            {
                Details.Delete(detail);
            }
            this.ImportSettings();
        }
Exemplo n.º 5
0
        protected virtual void Filter_NewCCProcessingCenterID_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e)
        {
            Filter filter = e.Row as Filter;

            if (filter == null)
            {
                return;
            }
            if (!string.IsNullOrEmpty(filter.NewCCProcessingCenterID))
            {
                CCProcessingCenter procCenter = PXSelect <CCProcessingCenter,
                                                          Where <CCProcessingCenter.processingCenterID, Equal <Required <CCProcessingCenter.processingCenterID> > > > .Select(this, filter.NewCCProcessingCenterID);

                if (!CCPaymentProcessing.IsFeatureSupported(procCenter, CCProcessingFeature.Tokenization))
                {
                    throw new PXSetPropertyException("New processing center should support tokenization!");
                }
            }
        }
Exemplo n.º 6
0
        protected virtual void CCProcessingCenterPmntMethod_RowPersisting(PXCache sender, PXRowPersistingEventArgs e)
        {
            CCProcessingCenterPmntMethod row = (CCProcessingCenterPmntMethod)e.Row;
            CCProcessingCenter           processingCenter = PXSelect <CCProcessingCenter,
                                                                      Where <CCProcessingCenter.processingCenterID, Equal <Required <CCProcessingCenter.processingCenterID> > > > .Select(this, row.ProcessingCenterID);

            if (processingCenter != null)
            {
                if (CCPaymentProcessing.IsFeatureSupported(processingCenter, CCProcessingFeature.Tokenization))
                {
                    PaymentMethodDetail ccpid = PXSelect <PaymentMethodDetail, Where <PaymentMethodDetail.paymentMethodID, Equal <Current <PaymentMethod.paymentMethodID> >,
                                                                                      And <PaymentMethodDetail.isCCProcessingID, Equal <True> > > > .Select(this);

                    if (ccpid == null)
                    {
                        throw new PXException(Messages.CCPaymentProfileIDNotSetUp);
                    }
                }
            }
        }