private static IEnumerable <V2.CreditCardData> GetExistingProfiles(ICardProcessingReadersProvider _provider)
 {
     return(_provider
            .GetCustomerCardsDataReaders()
            .Select(reader => V2ProcessingInputGenerator.GetCardData(reader))
            .Where(card => card.PaymentProfileID != null));
 }
예제 #2
0
            public void DeletePaymentProfile()
            {
                string customerProfileId = V2ProcessingInputGenerator.GetCustomerData(_provider.GetCustomerDataReader()).CustomerProfileID;
                string paymentProfileId  = V2ProcessingInputGenerator.GetCardData(_provider.GetCardDataReader()).PaymentProfileID;

                V2PluginErrorHandler.ExecuteAndHandleError(() => _processor.DeletePaymentProfile(customerProfileId, paymentProfileId));
            }
예제 #3
0
            public string CreateCustomerProfile()
            {
                V2.CustomerData customerData = V2ProcessingInputGenerator.GetCustomerData(_provider.GetCustomerDataReader());
                string          result       = V2PluginErrorHandler.ExecuteAndHandleError(() => _processor.CreateCustomerProfile(customerData));

                return(result);
            }
예제 #4
0
            public V2.CreditCardData GetPaymentProfile()
            {
                string customerProfileId = V2ProcessingInputGenerator.GetCustomerData(_provider.GetCustomerDataReader()).CustomerProfileID;
                string paymentProfileId  = V2ProcessingInputGenerator.GetCardData(_provider.GetCardDataReader()).PaymentProfileID;

                V2.CreditCardData result = V2PluginErrorHandler.ExecuteAndHandleError(() => _processor.GetPaymentProfile(customerProfileId, paymentProfileId));
                return(result);
            }
            public IEnumerable <V2.CreditCardData> GetAllPaymentProfiles()
            {
                V2.ICCProfileProcessor processor       = GetProcessor <V2.ICCProfileProcessor>();
                string customerProfileId               = V2ProcessingInputGenerator.GetCustomerData(_provider.GetCustomerDataReader()).CustomerProfileID;
                IEnumerable <V2.CreditCardData> result = V2PluginErrorHandler.ExecuteAndHandleError(() => processor.GetAllPaymentProfiles(customerProfileId));

                return(result);
            }
예제 #6
0
            public void GetCreateForm()
            {
                var processor = GetProcessor();

                V2.CustomerData customerData = V2ProcessingInputGenerator.GetCustomerData(_provider.GetCustomerDataReader());
                var             result       = V2PluginErrorHandler.ExecuteAndHandleError(() => processor.GetDataForCreateForm(customerData));

                throw new PXPaymentRedirectException(result.Caption, result.Url, result.Token, result.Parameters);
            }
예제 #7
0
            public string CreatePaymentProfile()
            {
                string customerProfileId = V2ProcessingInputGenerator.GetCustomerData(_provider.GetCustomerDataReader()).CustomerProfileID;

                V2.CreditCardData cardData    = V2ProcessingInputGenerator.GetCardData(_provider.GetCardDataReader(), _provider.GetExpirationDateConverter());
                V2.AddressData    addressData = V2ProcessingInputGenerator.GetAddressData(_provider.GetCustomerDataReader());
                cardData.AddressData = addressData;
                string result = V2PluginErrorHandler.ExecuteAndHandleError(() => _processor.CreatePaymentProfile(customerProfileId, cardData));

                return(result);
            }
예제 #8
0
            public IEnumerable <V2.CreditCardData> GetMissingPaymentProfiles()
            {
                var    processor         = GetProfileProcessor();
                string customerProfileId = V2ProcessingInputGenerator.GetCustomerData(_provider.GetCustomerDataReader()).CustomerProfileID;
                var    result            = V2PluginErrorHandler
                                           .ExecuteAndHandleError(
                    () => V2.InterfaceExtensions
                    .GetMissingPaymentProfiles(processor, customerProfileId, GetExistingProfiles(_provider)));

                return(result);
            }
            public void GetManageForm()
            {
                var processor = GetProcessor <V2.ICCHostedFormProcessor>();

                V2.CustomerData   customerData = V2ProcessingInputGenerator.GetCustomerData(_provider.GetCustomerDataReader());
                V2.CreditCardData cardData     = V2ProcessingInputGenerator.GetCardData(_provider.GetCardDataReader());
                var result = V2PluginErrorHandler.ExecuteAndHandleError(() => processor.GetDataForManageForm(customerData, cardData));

                throw new PXPaymentRedirectException(result.Caption, result.Url, result.UseGetMethod, result.Token, result.Parameters)
                      {
                          DisableTopLevelNavigation = result.DisableTopLevelNavigation
                      };
            }
            public TranProcessingResult DoTransaction(CCTranType aTranType, TranProcessingInput inputData)
            {
                V2.ICCTransactionProcessor processor = GetProcessor <V2.ICCTransactionProcessor>();
                var inputGenerator  = new V2ProcessingInputGenerator(_provider);
                var processingInput = inputGenerator.GetProcessingInput(aTranType, inputData);

                V2.ProcessingResult  v2Result = processor.DoTransaction(processingInput);
                TranProcessingResult result   = V2Converter.ConvertTranProcessingResult(v2Result);

                V2.ICCTranStatusGetter tranStatusGetter = _plugin.CreateProcessor <V2.ICCTranStatusGetter>(null);
                if (tranStatusGetter != null)
                {
                    V2.CCTranStatus tranStatus = tranStatusGetter.GetTranStatus(v2Result);
                    result.TranStatus = V2Converter.ConvertTranStatus(tranStatus);
                }
                return(result);
            }
            public V1.ProcessingResult DoTransaction(V1.CCTranType aTranType, V1.ProcessingInput inputData)
            {
                V2SettingsGenerator seetingsGen = new V2SettingsGenerator(_provider);

                V2.ICCTransactionProcessor processor = _plugin.CreateProcessor <V2.ICCTransactionProcessor>(seetingsGen.GetSettings());
                V1.ProcessingResult        result    = null;
                if (processor == null)
                {
                    string errorMessage = PXMessages.LocalizeFormatNoPrefixNLA(
                        Messages.FeatureNotSupportedByProcessing,
                        CCProcessingFeature.Base);
                    result = V1ProcessingDTOGenerator.GetProcessingResult(errorMessage);
                    return(result);
                }

                var inputGenerator  = new V2ProcessingInputGenerator(_provider);
                var processingInput = inputGenerator.GetProcessingInput(aTranType, inputData);

                V2.ProcessingResult v2Result = processor.DoTransaction(processingInput);
                result = V1ProcessingDTOGenerator.GetProcessingResult(v2Result);

                return(result);
            }
예제 #12
0
            public void DeleteCustomerProfile()
            {
                string customerProfileId = V2ProcessingInputGenerator.GetCustomerData(GetProvider().GetCustomerDataReader()).CustomerProfileID;

                V2PluginErrorHandler.ExecuteAndHandleError(() => GetProcessor().DeleteCustomerProfile(customerProfileId));
            }