public InstalmentPlan AddNewInstalmentPlan(InstalmentPlanViewDto instalmentPlanDto, int instalmentPlanCount)
        {
            InstalmentPlan InstalmentPlan = new InstalmentPlan()
            {
                Amount            = instalmentPlanDto.Amount,
                Count             = instalmentPlanDto.Count,
                PaymentMethodType = instalmentPlanDto.PaymentMethodType,
                CardBrand         = instalmentPlanDto.CardBrand,
                LineId            = (instalmentPlanCount + 1).ToString()
            };

            return(InstalmentPlan);
        }
        public InitRequest CreateInitRequest(IndexPageViewDto indexPageView)
        {
            InitRequestFactory InitRequestFactory = new InitRequestFactory();

            InitRequest InitRequest = new InitRequest()
            {
                Language    = indexPageView.MetaData.Language,
                HostAccount = indexPageView.MetaData.HostAccount,
                Payment     = InitRequestFactory.CreatePayment(indexPageView.PaymentView.Amount, indexPageView.PaymentView.Currency, indexPageView.PaymentView.PaymentSecurity)
            };

            foreach (InstalmentPlanViewDto dto in indexPageView.PaymentView.InstalmentPlans)
            {
                InstalmentPlan InstalmentPlan = InitRequestFactory.AddNewInstalmentPlan(dto, indexPageView.PaymentView.InstalmentPlans.Count - 1);
                InitRequest.Payment.InstalmentPlan.Add(InstalmentPlan);
            }

            InitRequest.Payment.PaymentReferenceNumber = indexPageView.PaymentView.PaymentReferenceNumber;
            InitRequest.ReturnUrl = Constants.RETURN_URL + "?paymentReferenceNumber=" + indexPageView.PaymentView.PaymentReferenceNumber;

            InitRequest = InitRequestFactory.Build(InitRequest);

            return(InitRequest);
        }