public static void DeletePaymentProfile(PXGraph graph, ICCPaymentProfileAdapter payment, ICCPaymentProfileDetailAdapter paymentDetail) { IEnumerator cpmEnumerator = payment.Cache.Deleted.GetEnumerator(); if (cpmEnumerator.MoveNext()) { ICCPaymentProfile current = (ICCPaymentProfile)cpmEnumerator.Current; ProcessingCardsPluginFactory pluginFactory = GetProcessingCardsPluginFactory(current.CCProcessingCenterID); CCProcessingCenter processingCenter = pluginFactory.GetProcessingCenter(); if (!string.IsNullOrEmpty(current.CCProcessingCenterID) && processingCenter.SyncronizeDeletion == true) { CCCustomerInformationManager cim = GetCustomerInformationManager(pluginFactory); CardProcessingReadersProvider readersProvider = new CardProcessingReadersProvider(new CCProcessingContext() { processingCenter = pluginFactory.GetProcessingCenter(), aCustomerID = current.BAccountID, aPMInstanceID = current.PMInstanceID, callerGraph = pluginFactory.GetPaymentProcessingRepository().Graph }); cim.SetReadersProvider(readersProvider); ICCPaymentProfileDetail ccpidCPMDet = null; PaymentMethodDetail ccpidPMDet = PXSelect <PaymentMethodDetail, Where <PaymentMethodDetail.paymentMethodID, Equal <Optional <CustomerPaymentMethod.paymentMethodID> >, And <PaymentMethodDetail.useFor, Equal <PaymentMethodDetailUsage.useForARCards>, And <PaymentMethodDetail.isCCProcessingID, Equal <True> > > > > .Select(graph, current.PaymentMethodID); foreach (ICCPaymentProfileDetail deletedDet in paymentDetail.Cache.Deleted) { if (deletedDet.DetailID == ccpidPMDet.DetailID) { ccpidCPMDet = deletedDet; break; } } if (ccpidCPMDet != null && !string.IsNullOrEmpty(ccpidCPMDet.Value)) { cim.DeletePaymentProfile(); } } } }
public static void DeletePaymentProfile(PXGraph graph, PXSelectBase <CustomerPaymentMethod> customerPaymentMethodView, PXSelectBase <CustomerPaymentMethodDetail> detailsView) { IEnumerator cpmEnumerator = customerPaymentMethodView.Cache.Deleted.GetEnumerator(); if (cpmEnumerator.MoveNext()) { CustomerPaymentMethod current = (CustomerPaymentMethod)cpmEnumerator.Current; CCProcessingCenter processingCenter = CCProcessingHelper.GetProcessingCenter(graph, current.CCProcessingCenterID); if (!string.IsNullOrEmpty(current.CCProcessingCenterID) && processingCenter.SyncronizeDeletion == true) { CCCustomerInformationManager cim = new CCCustomerInformationManager(current.CCProcessingCenterID, CCProcessingFeature.ProfileManagement) { CustomerID = current.BAccountID, PMInstanceID = current.PMInstanceID }; cim.CallerGraph = cim.ReadingGraph; CustomerPaymentMethodDetail ccpidCPMDet = null; PaymentMethodDetail ccpidPMDet = PXSelect <PaymentMethodDetail, Where <PaymentMethodDetail.paymentMethodID, Equal <Optional <CustomerPaymentMethod.paymentMethodID> >, And <PaymentMethodDetail.useFor, Equal <PaymentMethodDetailUsage.useForARCards>, And <PaymentMethodDetail.isCCProcessingID, Equal <True> > > > > .Select(graph, current.PaymentMethodID); foreach (CustomerPaymentMethodDetail deletedDet in detailsView.Cache.Deleted) { if (deletedDet.DetailID == ccpidPMDet.DetailID) { ccpidCPMDet = deletedDet; break; } } if (ccpidCPMDet != null && !string.IsNullOrEmpty(ccpidCPMDet.Value)) { cim.DeletePaymentProfile(); } } } }
public virtual void DeletePaymentProfile(PXGraph graph, ICCPaymentProfileAdapter payment, ICCPaymentProfileDetailAdapter paymentDetail) { CCCustomerInformationManager.DeletePaymentProfile(graph, payment, paymentDetail); }
public virtual void DeletePaymentProfile(PXGraph graph, PXSelectBase <CustomerPaymentMethod> customerPaymentMethodView, PXSelectBase <CustomerPaymentMethodDetail> detailsView) { CCCustomerInformationManager.DeletePaymentProfile(graph, customerPaymentMethodView, detailsView); }