Exemple #1
0
        public virtual ActionResult PaymentForm(PaymentModel paymentModel, PaymentForm form = null)
        {
            if (form == null)
            {
                form = new PaymentForm {StrategyId = paymentModel.StrategyId};

                if (paymentModel.RelatedId.HasValue)
                    form.RelatedId = paymentModel.RelatedId.Value;

                if (AuthenticationHelper.IsAuthenticated)
                    form.ClonePayersDataFromPreviousTransfer(AuthenticationHelper.CurrentUser);
            }

            var model = new PaymentFormModel
                {
                    PaymentForm = form,
                    Provider = PaymentHelper.PaymentProvider
                };

            if (paymentModel.Value.HasValue)
            {
                model.HasEnoughFunds = PaymentHelper.HasEnoughFunds(paymentModel.Value.Value);
                model.Funds = PaymentHelper.GetFunds();
            }

            return PartialView(MVC.Payment.Views._PaymentForm, model);
        }
Exemple #2
0
        public virtual ActionResult PaymentModal(int strategyId, int relatedId, decimal? value = null)
        {
            var model = new PaymentModel
                {
                    StrategyId = strategyId,
                    Value = value,
                    RelatedId = relatedId,
                };

            return PartialView(model);
        }