public static void DoDateUpdateProcess(CustomerPaymentMethod cpm)
        {
            CustomerPaymentMethodMaint cpmGraph = PXGraph.CreateInstance <CustomerPaymentMethodMaint>();

            cpmGraph.CustomerPaymentMethod.Current = cpm;
            CCCustomerInformationManager.SyncExistingPMI(cpmGraph, cpmGraph.CustomerPaymentMethod, cpmGraph.DetailsAll);
            cpm.ExpirationDate = cpmGraph.CustomerPaymentMethod.Current.ExpirationDate;
            if (cpm.ExpirationDate == null)
            {
                string formatString   = CCProcessingUtils.GetExpirationDateFormat(cpmGraph, cpm.CCProcessingCenterID);
                string responseString = null;
                foreach (PXResult <CustomerPaymentMethodDetail, PaymentMethodDetail> details in cpmGraph.DetailsAll.Select())
                {
                    PaymentMethodDetail         pmDetail  = details;
                    CustomerPaymentMethodDetail cpmDetail = details;
                    if (pmDetail.IsExpirationDate == true)
                    {
                        responseString = cpmDetail.Value;
                        break;
                    }
                }
                throw new PXException(Messages.ExpDateParseFailed, InterfaceConstants.ExpDateFormatDesc, responseString, formatString);
            }
            cpmGraph.Save.Press();
        }
Пример #2
0
        protected virtual void CCProcessingCenter_RowSelecting(PXCache sender, PXRowSelectingEventArgs e)
        {
            CCProcessingCenter row = e.Row as CCProcessingCenter;

            if (row == null)
            {
                return;
            }
            row.NeedsExpDateUpdate = CCProcessingUtils.CCProcessingCenterNeedsExpDateUpdate(this, row);
        }
Пример #3
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 void ARExpiredCardFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            ARExpiredCardFilter row = e.Row as ARExpiredCardFilter;

            if (row == null)
            {
                return;
            }
            PXUIFieldAttribute.SetEnabled <CustomerPaymentMethod.selected>(this.Cards.Cache, null, true);
            if (row.TokenizedPMs == null)
            {
                string pmString = CCProcessingUtils.GetTokenizedPMsString(this);
                sender.SetValue <ARExpiredCardFilter.tokenizedPMs>(row, pmString);
            }
            else
            {
                if (row.TokenizedPMs != String.Empty)
                {
                    Filter.Cache.RaiseExceptionHandling <ARExpiredCardFilter.customerClassID>(e.Row, ((ARExpiredCardFilter)e.Row).CustomerClassID,
                                                                                              new PXSetPropertyException(Messages.NotAllCardsShown,
                                                                                                                         PXErrorLevel.Warning, row.TokenizedPMs));
                }
            }
        }