Пример #1
0
        private void ImportSettingsFromPC(ICCPaymentProcessing aProcessor)
        {
            CCProcessingCenter row = this.ProcessingCenter.Current;
            Dictionary <string, CCProcessingCenterDetail> currentSettings = new Dictionary <string, CCProcessingCenterDetail>();

            ReadSettings(currentSettings);
            List <ISettingsDetail> processorSettings = new List <ISettingsDetail>();

            aProcessor.ExportSettings(processorSettings);
            foreach (ISettingsDetail it in processorSettings)
            {
                if (!currentSettings.ContainsKey(it.DetailID))
                {
                    CCProcessingCenterDetail detail = new CCProcessingCenterDetail();
                    detail.Copy(it);
                    detail = this.Details.Insert(detail);
                }
                else
                {
                    CCProcessingCenterDetail detail = currentSettings[it.DetailID];
                    detail.Copy(it);
                    detail = this.Details.Update(detail);
                }
            }
        }
Пример #2
0
 private void ImportExpDateFromPC(ICCPaymentProcessing aProcessor)
 {
     if (aProcessor is ICCProcessingExpDateFormatting)
     {
         CCProcessingCenterDetail detail = GetExpFormatDetail((ICCProcessingExpDateFormatting)aProcessor);
         detail = this.Details.Insert(detail);
     }
 }
Пример #3
0
        private ICCPaymentProcessing CreateAndInitProcessor(CCProcessingCenter row)
        {
            ICCPaymentProcessing processor = CCPaymentProcessing.CreateCCPaymentProcessorInstance(row);

            if (processor == null)
            {
                throw new PXException(Messages.InstanceOfTheProcessingTypeCanNotBeCreated, row.ProcessingTypeName);
            }
            processor.Initialize(this, null, null);
            return(processor);
        }
Пример #4
0
        protected virtual void ImportSettings()
        {
            CCProcessingCenter row = this.ProcessingCenter.Current;

            if (string.IsNullOrEmpty(row.ProcessingCenterID))
            {
                throw new PXException(Messages.ProcessingCenterIDIsRequiredForImport);
            }
            if (string.IsNullOrEmpty(row.ProcessingTypeName))
            {
                throw new PXException(Messages.ProcessingObjectTypeIsNotSpecified);
            }

            ICCPaymentProcessing processor = this.CreateAndInitProcessor(row);

            this.ImportSettingsFromPC(processor);
            this.ImportExpDateFromPC(processor);
        }
Пример #5
0
 public virtual IEnumerable UpdateExpirationDate(PXAdapter adapter)
 {
     if (ProcessingCenter.Current != null)
     {
         CCProcessingCenter row = ProcessingCenter.Current;
         if (string.IsNullOrEmpty(CCProcessingUtils.GetExpirationDateFormat(this, row.ProcessingCenterID)))
         {
             ICCPaymentProcessing processor = this.CreateAndInitProcessor(row);
             this.ImportExpDateFromPC(processor);
             this.Save.Press();
         }
         CCUpdateExpirationDatesProcess updateGraph = PXGraph.CreateInstance <CCUpdateExpirationDatesProcess>();
         updateGraph.Filter.Current = new CCUpdateExpirationDatesProcess.CPMFilter()
         {
             ProcessingCenterID = row.ProcessingCenterID
         };
         throw new PXRedirectRequiredException(updateGraph, true, "UpdateExpirationDate")
               {
                   Mode = PXBaseRedirectException.WindowMode.NewWindow
               };
     }
     return(adapter.Get());
 }
        public virtual IEnumerable ImportSettings(PXAdapter adapter)
        {
            CCProcessingCenter row = this.ProcessingCenter.Current;

            if (string.IsNullOrEmpty(row.ProcessingCenterID))
            {
                throw new PXException(string.Format(Messages.ProcessingCenterIDIsRequiredForImport));
            }
            if (string.IsNullOrEmpty(row.ProcessingTypeName))
            {
                throw new PXException(string.Format(Messages.ProcessingObjectTypeIsNotSpecified, row.ProcessingTypeName));
            }

            ICCPaymentProcessing processor = CCPaymentProcessing.CreateCCPaymentProcessorInstance(row);

            if (processor == null)
            {
                throw new PXException(string.Format(Messages.InstanceOfTheProcessingTypeCanNotBeCreated, row.ProcessingTypeName));
            }
            processor.Initialize(this, null, null);
            this.ImportSettingsFromPC(processor);
            return(adapter.Get());
        }