public virtual IEnumerable SyncCCPaymentMethods(PXAdapter adapter)
        {
            string methodName = GetClassMethodName();

            PXTrace.WriteInformation($"{methodName} started.");
            CustomerPaymentMethod currentPaymentMethod = CustomerPaymentMethod.Current;

            PXTrace.WriteInformation($"{methodName}. CCProcessingCenterID:{currentPaymentMethod.CCProcessingCenterID}; UserName:{this.Base.Accessinfo.UserName}");
            IEnumerable ret = adapter.Get();

            bool isCancel = false;

            System.Web.HttpRequest request = System.Web.HttpContext.Current.Request;
            var cancelStr = request.Form.Get("__CLOSECCHFORM");

            bool.TryParse(cancelStr, out isCancel);
            if (isCancel)
            {
                return(ret);
            }

            if (currentPaymentMethod.CCProcessingCenterID == null)
            {
                CustomerPaymentMethod.Cache.SetDefaultExt <CustomerPaymentMethod.cCProcessingCenterID>(currentPaymentMethod);
                CustomerPaymentMethod.Cache.SetDefaultExt <CustomerPaymentMethod.customerCCPID>(currentPaymentMethod);
            }
            var graph = PXGraph.CreateInstance <CCCustomerInformationManagerGraph>();

            ICCPaymentProfileAdapter       paymentProfile = new GenericCCPaymentProfileAdapter <CustomerPaymentMethod>(CustomerPaymentMethod);
            ICCPaymentProfileDetailAdapter profileDetail  = new GenericCCPaymentProfileDetailAdapter <CustomerPaymentMethodDetail, PaymentMethodDetail>(CustomerPaymentMethodDetail, PaymentMethodDetail);
            bool isIDFilled = CCProcessingHelper.IsCCPIDFilled(this.Base, CustomerPaymentMethod.Current.PMInstanceID);

            if (!isIDFilled)
            {
                graph.GetNewPaymentProfiles(this.Base, paymentProfile, profileDetail);
            }
            else
            {
                graph.GetPaymentProfile(this.Base, paymentProfile, profileDetail);
            }
            this.Base.Persist();
            return(ret);
        }