private static IPaymentResponseDestination CreateRequest(string destinationType)
        {
            if (CheckoutUtils.GetEnumMemberValue(PaymentDestinationType.Card).Equals(destinationType))
            {
                return(new PaymentResponseCardDestination());
            }

            return(new PaymentResponseAlternativeDestination());
        }
Beispiel #2
0
        private static WorkflowActionResponse Create(string type)
        {
            if (CheckoutUtils.GetEnumMemberValue(WorkflowActionType.Webhook).Equals(type))
            {
                return(new WebhookWorkflowActionResponse());
            }

            return(new WorkflowActionResponse());
        }
        private static IResponseSource CreateRequest(string sourceType)
        {
            if (CheckoutUtils.GetEnumMemberValue(PaymentSourceType.Card).Equals(sourceType))
            {
                return(new ResponseCardSource());
            }

            return(new AlternativePaymentSourceResponse());
        }
        private static IResponseSource CreateResponse(string sourceType)
        {
            if (CheckoutUtils.GetEnumMemberValue(PaymentSourceType.Card).Equals(sourceType))
            {
                return(new CardResponseSource());
            }

            if (CheckoutUtils.GetEnumMemberValue(PaymentSourceType.CurrencyAccount).Equals(sourceType))
            {
                return(new CurrencyAccountResponseSource());
            }

            return(new AlternativePaymentSourceResponse());
        }
        private static GetInstrumentResponse Create(string type)
        {
            if (CheckoutUtils.GetEnumMemberValue(InstrumentType.BankAccount).Equals(type))
            {
                return(new GetBankAccountInstrumentResponse());
            }

            if (CheckoutUtils.GetEnumMemberValue(InstrumentType.Card).Equals(type))
            {
                return(new GetCardInstrumentResponse());
            }

            return(new GetInstrumentResponse(
                       CheckoutUtils.GetEnumFromStringMemberValue <InstrumentType>(type)));
        }
Beispiel #6
0
        private static ISender CreateResponse(string senderType)
        {
            if (CheckoutUtils.GetEnumMemberValue(PaymentSenderType.Corporate).Equals(senderType))
            {
                return(new PaymentCorporateSender());
            }

            if (CheckoutUtils.GetEnumMemberValue(PaymentSenderType.Individual).Equals(senderType))
            {
                return(new PaymentIndividualSender());
            }

            if (CheckoutUtils.GetEnumMemberValue(PaymentSenderType.Instrument).Equals(senderType))
            {
                return(new PaymentInstrumentSender());
            }

            return(new ResponseAlternativeSender());
        }
        private static WorkflowConditionResponse Create(string type)
        {
            if (CheckoutUtils.GetEnumMemberValue(WorkflowConditionType.Entity).Equals(type))
            {
                return(new EntityWorkflowConditionResponse());
            }

            if (CheckoutUtils.GetEnumMemberValue(WorkflowConditionType.Event).Equals(type))
            {
                return(new EventWorkflowConditionResponse());
            }

            if (CheckoutUtils.GetEnumMemberValue(WorkflowConditionType.ProcessingChannel).Equals(type))
            {
                return(new ProcessingChannelWorkflowConditionResponse());
            }

            return(new WorkflowConditionResponse());
        }
        private static ScheduleResponse RetrieveScheduleResponseType(JToken jToken)
        {
            string sourceType = jToken.SelectToken(CheckoutUtils.Frequency)?.Value <string>()?.ToLowerInvariant();

            if (CheckoutUtils.GetEnumMemberValue(ScheduleFrequency.Daily).Equals(sourceType))
            {
                return(new ScheduleFrequencyDailyResponse());
            }

            if (CheckoutUtils.GetEnumMemberValue(ScheduleFrequency.Weekly).Equals(sourceType))
            {
                return(new ScheduleFrequencyWeeklyResponse());
            }

            if (CheckoutUtils.GetEnumMemberValue(ScheduleFrequency.Monthly).Equals(sourceType))
            {
                return(new ScheduleFrequencyMonthlyResponse());
            }

            return(new ScheduleResponse(CheckoutUtils.GetEnumFromStringMemberValue <ScheduleFrequency>(sourceType)));
        }